home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / utils1 / get26.arj / GETDOC.COM / GET.DOC
Text File  |  1992-03-12  |  166KB  |  3,502 lines

  1.   GET.DOC              GET Version 2.5              Copyright 1991 Bob Stephan
  2.  
  3.   READ.ME
  4.  
  5.     GET.EXE is a general purpose DOS BATch file enhancer.  It makes informa- 
  6.       tion available to the BATch file through the BATch IF subcommand.  The 
  7.       information can come from user input or from the operating system, and 
  8.       it is made available to the BATch file through the DOS ErrorLevel (Exit 
  9.       Code) and variables in the DOS master Environment. GET also has capabil- 
  10.       ities to set some system parameters and perform a few other specific ac- 
  11.       tions, over 30 functions in all.  Not only is GET wonderful for automat- 
  12.       ing your personal system, it is excellent for client support and soft- 
  13.       ware installation programs.  If you have been using an older version of 
  14.       GET, you will also be interested in the information in GET25NEW.DOC to 
  15.       help focus on the new and improved features.
  16.  
  17.     LICENSING SUMMARY
  18.  
  19.     GET is copyrighted software and is not in the public domain!  GET is not 
  20.       totally free for all users, and there are conditions imposed on its dis- 
  21.       tribution.  Please read this information and the section on Licensing 
  22.       and Distribution to be sure you are not using GET illegally.  The only 
  23.       version of GET that is free is the one that displays the help screen 
  24.       when the name GET is entered at the DOS prompt by itself.  If you have 
  25.       one that says it is licensed and you have not registered, you have a 
  26.       pirated copy that is protected by law.
  27.  
  28.     VENDORS, CORPORATE, and COMMERCIAL users see licensing terms under Licens- 
  29.       ing and Distribution.
  30.  
  31.     INDIVIDUALS, SHAREWARE AUTHORS, and SYSOPS.  For individuals this version 
  32.       of GET is free for personal use, and for the use of shareware authors in 
  33.       distributing their products subject to the conditions specified in the 
  34.       Licensing and Distribution terms below.  GET.EXE may be freely copied 
  35.       and distributed provided that all files in the GET package, including 
  36.       but not limited to GET.DOC and GET25NEW.DOC, are included on the disk or 
  37.       in the compressed file with GET.EXE.  Contributions to support this de- 
  38.       velopment project will be gratefully accepted.  If you use GET and can't 
  39.       send money, at least send thanks.  Programmers do not live by bread 
  40.       alone.  Besides, I'll put you on the list to help me distribute new 
  41.       releases as they become available.
  42.  
  43.     If you send $15 or more (overseas $20 U.S. funds) you will receive the 
  44.       following benefits: (California residents please add 7.75% sales tax.)
  45.       The latest version of GET with any new features plus one free upgrade.
  46.       A smaller runtime version to distribute with your BATch files.
  47.       A single user license with no royalties for use of the runtime version.
  48.       A >60 page user manual giving examples and detailed explanations.
  49.       Free support by BBS, mail, phone, CompuServe, or Genie (see below).
  50.       Notification of new releases and upgrades after the first one.
  51.  
  52.     If you have a modem, VISA and MASTERCARD registrations can be entered via 
  53.       NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  54.       tion, enter S for Script, then 3 for Script 3.
  55.  
  56.     If you have any questions, comments, or suggestions please contact me at:
  57.           MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
  58.       Phone: (408) 646-1899/1373.    GENIE:MOBYDISK.    COMPUSERVE:72357,2276
  59.       BBS: The Cricket 408-373-3773         /s/ Bob Stephan   January 10, 1992
  60.  
  61.  
  62.   GET 2.5                       Table of Contents                      Page ii
  63.  
  64.                                Table of Contents
  65.  
  66.   READ.ME....................................................................i
  67.   LICENSING SUMMARY..........................................................i
  68.     Vendors, Corporate, and Commercial Users.................................i
  69.     Individuals, Shareware Authors, and SYSOPS...............................i
  70.   VISA and MASTERCARD........................................................i
  71.   SYSTEM REQUIREMENTS........................................................1
  72.   ACKNOWLEDGMENTS............................................................1
  73.   ABOUT THE AUTHOR...........................................................2
  74.   LIMITED WARRANTY (and other legalities)....................................2
  75.   HELP SCREEN................................................................3
  76.   ENTERING COMMANDS..........................................................5
  77.   SEE HOW IT RUNS............................................................5
  78.   SYNTAX EXPLANATIONS........................................................6
  79.     Command..................................................................6
  80.     Argument(s)..............................................................6
  81.       [] brackets............................................................6
  82.       "" double quotes.......................................................6
  83.       filespec...............................................................6
  84.       chars..................................................................6
  85.       #......................................................................6
  86.       num, div...............................................................6
  87.     Environment..............................................................6
  88.     ErrorLevel...............................................................7
  89.     Extended.................................................................7
  90.     Surrogates...............................................................7
  91.     Switches.................................................................7
  92.   ERRORLEVEL.................................................................8
  93.   SWITCHES..................................................................10
  94.     /A...........................Prompt Attribute...........................10
  95.     /B.........................Flush Keyboard Buffer........................11
  96.     /C..........................Suppress Ctrl-Break.........................11
  97.     /E.............................Enhanced Keys............................11
  98.     /L...............................Lowercase..............................11
  99.     /M..........................Master Environment..........................11
  100.     /TR..............................Trim Right.............................11
  101.     /TL..............................Trim Left..............................11
  102.     /U...............................Uppercase..............................12
  103.     /V.............................Variable Name............................12
  104.     /W............................Wait or Number............................12
  105.     /X....................Extended Keys or eXtra function...................12
  106.     /~..........................GET S Escape Action.........................13
  107.   USING GET COMMANDS........................................................14
  108.   STRING HANDLING AND SCREEN I/O............................................14
  109.     GET C...........................GET Character...........................18
  110.     GET N.........................GET yes/no aNswer.........................21
  111.     GET T............................Moving Text............................23
  112.     GET S.............................GET String............................25
  113.     GET I..........................Check Key Buffer.........................28
  114.     GET Z..........................Put String (Zap).........................30
  115.     GET ZE..........................Standard Input..........................32
  116.     GET R.............................'Rithmetic............................34
  117.     GET B........................Clear (Blank) Screen.......................36
  118.     GET V.........................Get/set video mode........................37
  119.     GET VE.......................Get/set video border.......................38
  120.     GET H...........................Date and Time...........................39
  121.     GET U..........................Keyboard BUffer..........................42
  122.  
  123.   Page iii                      Table of Contents                      GET 2.5
  124.  
  125.     GET UE............................Shift Locks...........................44
  126.   GET DISK and FILE Information.............................................45
  127.     GET K........................Get disk free space........................45
  128.     GET Q.....................Get Disk Capacity (Quota).....................47
  129.     GET L..........................Get volume label.........................49
  130.     GET LE........................Match volume label........................51
  131.     GET F...........................Get file size...........................52
  132.     GET Y.........................Current Directory.........................56
  133.     GET YE...........................Logged Drive...........................56
  134.   GET MEMORY and SYSTEM Information.........................................58
  135.     GET BR........................Get/Set Break Flag........................58
  136.     GET P.......................Check for Printer(PRN)......................59
  137.     GET PE......................Initialize Printer(PRN).....................59
  138.     GET E........................Get Environment Left.......................60
  139.     GET M..........................Get Memory Free..........................61
  140.     GET D..........................Get DOS Version..........................62
  141.     GET 7.........................Check Coprocessor.........................63
  142.     GET 7E..........................Check CPU Type..........................63
  143.     GET 4.........................Check 4DOS Status.........................64
  144.     GET 4E.......................Check Windows Status.......................64
  145.     GET A.........................Check for ANSI.SYS........................65
  146.     GET AE.....................Check for ROM BIOS Model.....................65
  147.     GET W...........................Warm/Cold Boot..........................66
  148.   The Environment and Shells................................................67
  149.   Out of Environment space..................................................67
  150.   PROGRAM INFORMATION.......................................................69
  151.   LICENSING AND DISTRIBUTION................................................69
  152.     Corporate Users.........................................................69
  153.     SYSOPs, User Groups, and Shareware authors..............................70
  154.     Vendors.................................................................70
  155.     Registered Users........................................................70
  156.   Now for the commercial....................................................70
  157.   SPECIAL OFFER.............................................................71
  158.   Appendix A.......................The DOS Environment.......................A-1
  159.   Appendix B.......................ASCII and Scan Codes......................B-1
  160.  
  161.   GET 2.5                          INTRODUCTION                         Page 1
  162.  
  163.     INTRODUCTION
  164.  
  165.     BATch programming can make your computing life easier.  BATch programming 
  166.       with GET can make your BATch programming much easier and more produc- 
  167.       tive.  Most versions of DOS do not support a wide variety of useful fea- 
  168.       tures in the BATch programming commands that are available.  GET supple- 
  169.       ments these commands, and gives BATch the capabilities it needs to real- 
  170.       ly do a proper job as a macro language.
  171.  
  172.     GET provides additional commands in four general areas:
  173.  
  174.            String Handling and Screen I/O Commands
  175.            Disk and File Commands
  176.            Memory and System Commands
  177.  
  178.     The commands are fully described herein, along with some general informa- 
  179.       tion on BATch programming and the use of ErrorLevel and the DOS Environ- 
  180.       ment.  However, this is not a BATch programming tutorial or primer. 
  181.       Many useful books and publications can give you startup help if you need 
  182.       it.  Among those that I am familiar with are "MS-DOS Batch File Program- 
  183.       ming" by Ronny Richardson, Windcrest, 2nd Ed. 1990, and "DOS Power 
  184.       Tools" mentioned below.
  185.  
  186.     SYSTEM REQUIREMENTS
  187.  
  188.     GET is compatible with all computers running under DR, MS or PC-DOS Ver- 
  189.       sions 2.0 and later, although 3.1 or later is preferred.  It requires 
  190.       only about 11K of memory and is stored on disk in a smaller compressed 
  191.       format.  It is not memory resident (TSR) and will not reduce the amount 
  192.       of memory available to other programs.  It supports all types of 
  193.       monitors and display adapters whether monochrome or color.
  194.  
  195.     To support the many features of GET it is preferable if you are running 
  196.       DOS 3.1 or later.  A few of the features may not work on earlier ver- 
  197.       sions, or with some of the early XT and AT ROM BIOS's.  Where these 
  198.       limitations are known, they are mentioned in this document.
  199.  
  200.     ACKNOWLEDGMENTS
  201.  
  202.       My thanks to members of MBUG-PC, The Monterey Bay Users' Group - Per- 
  203.       sonal Computer, for their indulgence during my development of this sys- 
  204.       tem.  Many members have used preliminary versions and offered their com- 
  205.       ments and suggestions.  I am particularly grateful to the beta testers 
  206.       who held my feet to the fire to ensure that this would be a reliable and 
  207.       useful product.  Among those in MBUG-PC who have been particularly help- 
  208.       ful are (in alphabetical order) Fred Brownell, Fred Huddle, Lee Keely, 
  209.       Jim Robeson, and Luther Schliesser.  Others who have been very helpful 
  210.       are Kevin Paddock and Steve Ferg.  I am also grateful to Bantam Computer 
  211.       Books for including GET in the Revised Second Edition of "DOS Power 
  212.       Tools," and Ronny Richardson for including it in his book mentioned 
  213.       above.
  214.  
  215.  
  216.  
  217.   Page 2                          INTRODUCTION                         GET 2.5
  218.  
  219.     ABOUT THE AUTHOR
  220.  
  221.     Bob Stephan has been using and programming computers for over 25 years, 
  222.       mostly for other companies and for his own use and enjoyment.  Shareware 
  223.       is his first independent commercial venture (see the commercial at the 
  224.       end of this document).  He has been a mainstay in his local computer 
  225.       users group for over 8 years and is a past president as well as an au- 
  226.       thor of informative articles for the newsletter, leader of special in- 
  227.       terest groups, and provider of help to members on a variety of topics.
  228.  
  229.     LIMITED WARRANTY (and other legalities)
  230.  
  231.     Bob Stephan warrants the physical diskette and physical documentation pro- 
  232.       vided with the registered version to be free of defects in materials and 
  233.       workmanship for a period of sixty days from the purchase date.  The 
  234.       entire and exclusive liability and remedy for breach of this Limited 
  235.       Warranty shall be limited to replacement of the defective diskette or 
  236.       documentation and shall not include or extend to any claim for or right 
  237.       to recover any other damages, including but not limited to loss of prof- 
  238.       it, data, or use of the software, or special, incidental, or consequen- 
  239.       tial damages or other similar claims.  In no event will any liability 
  240.       for damages ever exceed the registration fee actually paid for the li- 
  241.       cense to use the software, regardless of any form of the claim.  Bob 
  242.       Stephan specifically disclaims all other warranties, express or implied, 
  243.       including but not limited to, any implied warranty of merchantability or 
  244.       fitness for a particular purpose.
  245.  
  246.     Be that as it may, I claim that this software will perform substantially 
  247.       as detailed in this documentation when used on a machine with compatible 
  248.       software (DOS) and compatible firmware (ROM BIOS).  If it does not work 
  249.       as documented when used in conformance with this documentation, I will 
  250.       either fix it if it is broken or refund your registration fee.  If you 
  251.       are not satisfied, return the original registered disk and documentation 
  252.       within 30 days for a full refund of the registration fee paid.
  253.  
  254.     DR DOS, MS DOS, and 4DOS are trademarks of their respective companies.
  255.  
  256.  
  257.  
  258.   GET 2.5                          HELP SCREEN                          Page 3
  259.  
  260.     HELP SCREEN
  261.  
  262.     If you enter GET at the DOS prompt by itself, or with any invalid argument 
  263.       such as a question mark, it will display the following summary of all 
  264.       GET commands:
  265.  
  266. ╔══════════════════════════════════════════════════════════════════════════════╗
  267. ║ GET Version 2.5   -   BATch File Enhancer   -   Copyright 1991 Bob Stephan   ║
  268. ║  Syntax:  GET command argument(s) /switches     More Instructions: GET.DOC   ║
  269. ║Purpose             Command   Argument(s)   Environment  ErrorLevel  Extended ║
  270. ║---------           -------   -----------   --(GET=)---  --(Exit)--  --[E]--- ║
  271. ║          --------- String Handling and Screen I/O Commands --------          ║
  272. ║Get character(InKey)C[E] ["prompt"][chars]   Character   ASCII code  No Echo  ║
  273. ║Get yes/no aNswer   N[E] ["prompt"][seconds] Character   ASCII code  No Echo  ║
  274. ║Get string          S[E] ["prompt"][pattern] String      Length      No Echo  ║
  275. ║Put string (Zap)    Z[E] ["string/prompt"]   String      Length      StdInput ║
  276. ║Moving Text(GetaKey)T[E] "filespec" [chars]  Character   ASCII code  No Echo  ║
  277. ║Key check (IsKey)   I[E]                     Char.Waitng Char.Waitng Get Char ║
  278. ║Date and Time       H[E] 1=DoW 2=DoM 4=Mon 8=Yr 16=Hr 32=Min 64=Sec  Sum/Cat  ║
  279. ║Keyboard BUffer     U[E] ["chars"][num][/Wnum]  --       Length      Caps/Num ║
  280. ║'Rithmetic (add)    R[E]  [num] [/Wnum]      Sum/Diff    Sum/Diff    Subtract ║
  281. ║Clear (Blank) Screen  B[E] [New attribute]      Old attribute        HexAttr  ║
  282. ║Video mode/VGA border V[E] [New mode/color]     Old mode/color      VGA Border║
  283. ║          --------- Disk and File Commands --------                           ║
  284. ║Get file size (DIR=0)  F[E] filespec[/WdivXA]Bytes/Hex   Kilobytes   Kb/10    ║
  285. ║Get disk free space    K[E] [drive] [/Wdiv]  Kilobytes   Kb/10       Kb/100   ║
  286. ║Get disk capacity      Q[E] [drive] [/Wdiv]  Kilobytes   Kb/10       Kb/100   ║
  287. ║Get volume label       L[E] ["label"][drive] Label       1=yes,0=no  Match    ║
  288. ║Get current directory  Y[E] [drive for Y]    Directory   Level/Drive Drive:A=0║
  289. ║          --------- Memory and System Commands --------                       ║
  290. ║Get Environment left   E[E]                  Bytes left  Bytes left  Bytes/10 ║
  291. ║Get memory free        M[E]                  Kilobytes   Kilobytes   Kb/10    ║
  292. ║Get/Set Break Flag     BR   [New flag 1=on, 0=off]   Old flag        None     ║
  293. ║Check for printer(PRN) P[E]                  1=yes,0=no  1=yes,0=no Initialize║
  294. ║Check 4DOS/Windows     4[E]                  1=yes,0=no  1=yes,0=no  Windows  ║
  295. ║Get DOS version        D[E]                  Major Vers. MajorMinor  MinorEnv ║
  296. ║Check coprocessor/CPU  7[E]                  1=yes,0=no  1=yes,0=no  CPU Type ║
  297. ║Check ANSI.SYS/Model   A[E]                  1=yes,0=no  1=yes,0=no  PC Model ║
  298. ║Warm/Cold Boot         W[E] If argument given then 1=warm, 0=cold    ColdBoot ║
  299. ║ Surrogates: }=Carriage Return, ~=Escape, Alt-255=Space/Blank.                ║
  300. ║ SWITCHES: /C Ctrl-Break, /U /L case, /M Master Env, /E Enhanced keys, /Vvar= ║
  301. ║  /X eXtended keys/Hex, /A[nnn] prompt Attribute, /W[nnnn] Wait seconds/div   ║
  302. ║  /B flush key Buffer, /TL /TR Trim, /~ Escape action for GET S, /V- No var   ║
  303. ║ See GET.DOC for additional features and BATch programming instructions.      ║
  304. ╚══════════════════════════════════════════════════════════════════════════════╝
  305.  
  306.     Displaying the help screen by simply entering GET will now pause at the 
  307.       end of the second screen with the message
  308.  
  309.       Press PgUp to repeat the first screen - Esc, CR, or space bar to exit
  310.  
  311.     Pressing PgUp at this point will start the help screen display over again. 
  312.       Pressing CR (Enter or Return on the keyboard) will exit and clear the 
  313.       screen giving you a clear screen to work on.  Pressing Esc or the space 
  314.       bar will exit and leave the second help screen on the display for 
  315.       reference.  The pause will time out in 10 seconds and return to the DOS 
  316.       prompt automatically.
  317.  
  318.  
  319.  
  320.   GET 2.5                          HELP SCREEN                          Page 4
  321.  
  322.     You can make a file copy of this Help Screen by using DOS redirection. 
  323.       Enter the command GET >GET.HLP.  When you see the --More-- prompt, press 
  324.       Enter again.  This Help Screen will be in the file GET.HLP.  When you 
  325.       are BATch programming, put the help file in one of your editor's windows 
  326.       where you can use it for quick reference.
  327.  
  328.  
  329.  
  330.   GET 2.5                       ENTERING COMMANDS                       Page 5
  331.  
  332.     ENTERING COMMANDS
  333.  
  334.     GET is used in BATch files.  When you want to use GET in a BATch file use 
  335.       the following simple procedure:
  336.  
  337.     1. Enter the word GET as the first entry on a line, followed by a space.
  338.  
  339.     2. Tell GET what it is that you want it to get for you.  Do this by selec- 
  340.       ting and entering a one or two letter command from the Command column on 
  341.       the HELP SCREEN.  All of the commands are described in this document.
  342.  
  343.     3. If there are arguments, enter a space and then the arguments that you 
  344.       need or want to run the command.
  345.  
  346.     4. If you want to use any of the /switches, enter them on the same line 
  347.       after all argument(s).
  348.  
  349.     5. On the next line of the BATch file, check the return from GET in the 
  350.       ErrorLevel and/or the GET= variable in the Environment.  The Environment 
  351.       variable can be accessed as %GET% or by the name you give it with the /V 
  352.       switch described below.
  353.  
  354.     For example, to get a yes or no answer you might enter the lines:
  355.  
  356.          :Ask
  357.          GET N "Answer yes or no: "
  358.          IF "%GET%"=="N" goto NO
  359.          IF "%GET%"=="Y" goto YES
  360.          Rem The next line checks to see if the user pressed Escape
  361.          if ErrorLevel 126 goto END
  362.          ECHO You must enter Y or N, or press Esc to exit.
  363.          goto ASK
  364.          :NO
  365.          Rem [Do what you need to do if the user enters N]
  366.          goto END
  367.          :YES
  368.          Rem [Do what you need to do if the user enters Y]
  369.          :END The next line clears GET out of the Environment.
  370.          set GET=
  371.  
  372.     SEE HOW IT RUNS
  373.  
  374.     The best way to find out how GET works is to just try it.  You can try it 
  375.       from the command line by using the special built-in reporting feature. 
  376.       To see what GET is putting in the ErrorLevel and the Environment, issue 
  377.       the DOS command SET GET?=ON.  This will tell GET to report the results 
  378.       to the screen in addition to placing them in the ErrorLevel and the En- 
  379.       vironment.  Then run the GET commands that you want to check out, or run 
  380.       your BATch file to see what GET reports.
  381.  
  382.     You can also try GET from the command line if you use SET (by itself) to 
  383.       check what has been placed in the Environment, but to find out what is 
  384.       in the ErrorLevel, you must use a BATch file unless you SET GET?=ON.  If 
  385.       you are not familiar with the DOS Environment, see the discussion of En- 
  386.       vironment and Shells elsewhere in this documentation.
  387.  
  388.  
  389.   Page 6                       ENTERING COMMANDS                       GET 2.5
  390.  
  391.   SYNTAX EXPLANATIONS (Refer to the HELP SCREEN)
  392.  
  393.     Command: Commands are one or two character combinations as shown on the 
  394.       HELP SCREEN.  Single character commands can [optionally] be immediately 
  395.       followed by E with no spaces between.  The E indicates the Extended 
  396.       function in the last column on the HELP SCREEN.
  397.  
  398.     Argument(s):  Arguments are zero, one, or two character strings as ap- 
  399.       propriate to the command.  A "string" is a sequence of consecutive ASCII 
  400.       characters delimited by double quotes or, if not in quotes, by the space 
  401.       character.  In some cases the first, or only, argument must be enclosed 
  402.       in double quotes as shown on the HELP SCREEN.  Arguments that are not 
  403.       shown in quotes on the HELP SCREEN must not be put in quotes.  Each 
  404.       character string can consist of zero or more ASCII characters.  The 
  405.       blank or space character (ASCII 32) delimits the character strings that 
  406.       are not in quotes.  The space character can only be a member of one of 
  407.       the strings that is enclosed in double quotes.  (In this document, both 
  408.       "blank" and "space" are used as synonyms for the ASCII-32 character.)
  409.  
  410.       [] brackets indicate optional portions of commands and/or arguments. The 
  411.         command will work regardless whether these portions are included or 
  412.         not.  The brackets themselves must not be included!
  413.  
  414.       "  Where double quotes ("'s) are shown, they must be included if the 
  415.         corresponding prompt, string, or filespec argument is used.
  416.  
  417.       filespecs consist of a filename and extension as appropriate to the DOS 
  418.         file naming conventions.  They may include drive and path but no wild- 
  419.         cards in the general form of d:\path\filename.ext.
  420.  
  421.       chars refers to an ASCII character string which can include any of the 
  422.         ASCII characters from decimal 33 to decimal 255 inclusive, but some of 
  423.         these characters have special significance.  Blanks can only be used 
  424.         in  strings that must be enclosed in double quotes (but see the use of 
  425.         surrogates below.)  IMPORTANT: All characters in the chars argument 
  426.         must be in a contiguous string with no blanks, including any surrogate 
  427.         characters!  If you want to specify the space character use the Alt- 
  428.         255 surrogate.
  429.  
  430.       # is now obsolete.  Although it is still supported in Version 2.5 for 
  431.         compatibility, it must be replaced with the /W syntax because # will 
  432.         not be supported in future versions. The new and preferred method is 
  433.         to use the /W switch.  Note that because of this special significance, 
  434.         # cannot be used as an input character in the chars string.
  435.  
  436.       num and div must be entered as ASCII decimal digit characters represent- 
  437.         ing a number containing no more than 4 digits.  The new preferred 
  438.         syntax is to use the /W switch to enter numbers where the old syntax 
  439.         was #num or #div.
  440.  
  441.     Environment: this column indicates what will be found in the Environment 
  442.       string GET= or the one you name with the /V switch.  This string can be 
  443.       accessed from a BATch file with the %GET% notation. It is best to en- 
  444.       close %GET% in double quote characters in case it is empty.  For exam- 
  445.       ple:
  446.          IF "%GET%"==""
  447.       will check for an empty GET variable.  The variable name can be changed 
  448.       with the /V switch described below.  If you need more information on 
  449.       testing Environment variables, see the section on Environment and Shells 
  450.       later in this document.
  451.  
  452.  
  453.   GET 2.5                       ENTERING COMMANDS                       Page 7
  454.  
  455.  
  456.     ErrorLevel: this column indicates what value will be placed in the DOS Er- 
  457.       rorLevel where it can be accessed in BATch files with the "IF Error- 
  458.       Level" subcommand.  Always check for ErrorLevel from highest to lowest 
  459.       values of interest. ErrorLevel is also referred to as Exit Code or 
  460.       Return Code.  If you need more information on testing the ErrorLevel, 
  461.       see the next section on ERRORLEVEL.
  462.  
  463.     Extended: this column indicates the action taken if the optional E for 
  464.       [E]xtended command is included.  Do not include the brackets! In most 
  465.       cases E applies to either the result in the Environment or the result in 
  466.       the ErrorLevel, but not to both.  In a few cases the E invokes a sepa- 
  467.       rate but loosely related function.
  468.  
  469.     Surrogates:  Some characters are awkward or impossible to handle directly 
  470.       in BATch files.  For example, BATch files generally use the carriage 
  471.       return <CR> and space characters as delimiters instead of as ASCII 
  472.       characters that can be manipulated.  Some special symbols have been 
  473.       designated to facilitate the handling of these characters.  These sub- 
  474.       stitutions may have different meanings depending on the command being 
  475.       used, so read the description of the command.  The special characters 
  476.       are:
  477.            Carriage Return: } is used for CR
  478.            Escape:          ~ is used for Esc
  479.            Blank:     Alt-255 is used for Space (Blank).
  480.  
  481.       The Alt-255 character can be entered in most text editors by holding 
  482.       down the Alt key while spelling out the digits for the character on the 
  483.       number pad of the keyboard, but check your text editor for this capabil- 
  484.       ity.
  485.  
  486.       It is often convenient to ask the user to press the space bar.  The 
  487.       blank (or space) surrogate, Alt-255, makes it possible to check for a 
  488.       space.  In most versions of DOS the subcommand IF "%GET%"==" ", or any 
  489.       comparison of strings which include spaces, does not work properly since 
  490.       DOS uses the space as a delimiter.  By using Alt-255 as a surrogate for 
  491.       the space character, WYSIWYG is maintained, and the character can be 
  492.       manipulated like any alphabetic character.  4DOS, however, treats 
  493.       strings in double quotes properly.
  494.  
  495.     Switches are special modifiers to GET commands.  A switch is indicated by 
  496.       the forward slash character, "/", immediately followed by the ap- 
  497.       propriate letter or character.  See SWITCHES, page 10.
  498.  
  499.  
  500.  
  501.   Page 8                        The Error Level                        GET 2.5
  502.  
  503.   ERRORLEVEL
  504.  
  505.   If you are not familiar with testing for the ErrorLevel in BATch files, read 
  506.     this section.  If the ErrorLevel holds no mysteries for you, then skip to 
  507.     the next section.  To test a program to determine what ErrorLevel(s) it 
  508.     returns, use RUN.EXE included in GET25.ZIP.  See RUN.DOC for details.
  509.  
  510.   Most modern programs that run under DOS issue a numeric status code which is 
  511.     passed back to DOS when they terminate.  This is variously referred to as 
  512.     a "return code", "exit code", "status code", "error code", "Error Level", 
  513.     etc.. An "ErrorLevel" is simply that code, whatever it may be called. 
  514.     Generally, an errorlevel of 0 means a normal, successful completion, and a 
  515.     non-zero return code indicates a problem of some sort.  GET uses the Er- 
  516.     rorLevel for different purposes to pass information back to the BATch file 
  517.     in such a way that the BATch file can make use of it with the IF ERROR- 
  518.     LEVEL subcommand.
  519.  
  520.   IF ERRORLEVEL is one of the cases of the IF statement.  It tests the return 
  521.     code from the program for some condition that you specify.  The various IF 
  522.     tests always result in a true/false result - either the test is true or it 
  523.     is false.  If it is true, the statement following the IF test on the same 
  524.     line is executed, otherwise it is ignored.  The IF ERRORLEVEL test is al- 
  525.     ways a "greater than or equal" test, or in BASIC parlance >=.  So when you 
  526.     enter IF ERRORLEVEL 5 DO SOMETHING, it means "if the return code from the 
  527.     previous program is greater than or equal to 5" the BATch file is to do 
  528.     something, otherwise it will ignore the rest of the line starting with IF.
  529.  
  530.   To test specifically for an ErrorLevel of 0 you use the NOT parameter for 
  531.     the IF subcommand.  So when you enter IF NOT ERRORLEVEL 1 DO SOMETHING 
  532.     ELSE, it means "if the return code is not greater than or equal to 1 do 
  533.     something else."  Since return codes can only be integers 0 through 255, a 
  534.     return code that is not >= 1, can only be 0, hence the test for Error- 
  535.     Level=0.
  536.  
  537.   ERRORLEVEL tests can be "and"ed to test for a specific return code.  If you 
  538.     enter IF ERRORLEVEL 5 IF NOT ERRORLEVEL 6 DO STILL ANOTHER THING, it means 
  539.     "if the return code is greater than or equal to 5 but not greater than or 
  540.     equal to 6 do still another thing."  The only integer that satisfies those 
  541.     conditions is 5 itself.
  542.  
  543.   Not all programs return error levels.  DOS itself is the worst offender.  No 
  544.     internal commands that I know of return codes, and not all the external 
  545.     commands are so thoughtful.  Later versions of DOS are getting better 
  546.     about returning and documenting such codes, but unless it is documented 
  547.     that a code is returned and what it signifies, there is no way to assume 
  548.     that one is available.  To find out what a return code means you must read 
  549.     the documentation for the program or command.
  550.  
  551.   If there is a possibility of several return codes, the IF ERRORLEVEL tests 
  552.     must be used in descending order because of the >= meaning.  For example, 
  553.     the MS DOS 5.0 FORMAT command is documented to have the following "exit 
  554.     codes."
  555.  
  556.       0  The format operation was successful.
  557.  
  558.       3  The user pressed Ctrl-C to stop the process.
  559.  
  560.       4  A fatal error occurred (any error other than 0, 3, or 5).
  561.  
  562.  
  563.   GET 2.5                        The Error Level                        Page 9
  564.  
  565.  
  566.       5  The user pressed N in response to the prompt "Proceed with 
  567.     Format(Y/N)?" to stop the process
  568.  
  569.     You can set up a BATch file to automate the FORMATTING process, then check 
  570.     to see if it was successful.  A portion of your BATch file might look like 
  571.     this:
  572.  
  573.   :AGAIN
  574.   FORMAT %1 %2 %3
  575.   if ErrorLevel 5 goto DONE
  576.   if ErrorLevel 4 goto ERROR
  577.   if ErrorLevel 3 goto ASK
  578.   Rem If it wasn't one of the above, it has to be 0,
  579.   Rem so go back to see if you want to do it again.
  580.   goto AGAIN
  581.   :ERROR Come here if a fatal error occurred - code=4.
  582.   ECHO The FORMAT command failed!
  583.   :ASK Come here if the ErrorLevel was 3 - user pressed Ctrl-C
  584.   GET N "Do you want to try another disk?"
  585.   if "%GET%"=="Y" goto AGAIN
  586.   :DONE
  587.   Echo The FORMAT operation has been completed!
  588.   Echo Have a good day.
  589.  
  590.  
  591.   Page 10                           SWITCHES                           GET 2.5
  592.  
  593.   SWITCHES
  594.  
  595.   Switches are special modifiers to GET commands.  A switch is indicated by 
  596.     the forward slash character, "/", immediately followed by the appropriate 
  597.     letter or character.  More than one switch may be used with a command, and 
  598.     all switches must come after any other arguments.  Switches that are not 
  599.     applicable to a command will be ignored and not cause any harm if in- 
  600.     advertently included.  Some switches replace the "surrogate" character 
  601.     syntax that was used in GET Version 2.2 and earlier.  The old syntax has 
  602.     been retained in Version 2.5 for compatibility, but will be eliminated in 
  603.     future versions.  Where the switches duplicate other features, the switch 
  604.     is the preferred method.  The switches that have been implemented in 
  605.     Release 2.5 are /A, /B, /C, /E, /L, /M, /TR, /TL, /U, /V, and /W.
  606.  
  607.   /A lets you control the screen attribute of prompts.  The prompts can be 
  608.     displayed in reverse video, or any of 254 color combinations that are 
  609.     available on color monitors.  /A by itself causes the prompt to be dis- 
  610.     played in reverse video.  /Annn, where nnn is a number between 1 and 254 
  611.     specifies the attribute to be used for the prompt.  The following table 
  612.     explains how to construct the attribute.  It is not necessary to have 
  613.     ANSI.SYS or any of its clones loaded to display prompts with attributes.
  614.  
  615.           The color codes are:
  616.              0 Black         2 Green      4 Red          6 Brown
  617.              1 Blue          3 Cyan       5 Magenta      7 White
  618.  
  619.           For the foreground color for the characters:
  620.              1. Select the color number from the above table.
  621.              2. For high intensity (bright or light), add 8.
  622.              3. For Blinking, add 128.
  623.           Example:
  624.              Blinking, high-intensity magenta is 5+8+128=141
  625.  
  626.           For the background color:
  627.              1. Select the color number from the above table.
  628.              2. Multiply it by 16.
  629.              3. Add it to the foreground color.
  630.     Example:
  631.     Blinking, high-intensity magenta on white is 141+(7*16)=253
  632.     GET C "This is in blinking, high-intensity, magenta on white " /A253
  633.  
  634.     With some command processors (4DOS is one), there can be a minor problem 
  635.     if the user presses break when the prompt is displayed on the bottom line 
  636.     of the screen if using GET ZE for input.  If you are using GET ZE for in- 
  637.     put, you probably don't want to use /A to specify an attribute for the 
  638.     prompt.  This will prevent the prompt color from being taken by DOS as the 
  639.     new color to use for scrolling the screen if the user presses a break key.
  640.  
  641.     As mentioned above, you can use /A to echo text to the screen in color. 
  642.     Any of the commands that display a prompt can do it if you specify 0 sec- 
  643.     onds to wait.  GET I does not wait anyway, and it will display a prompt if 
  644.     there is one specified, so it is a good choice to use for the Echo command 
  645.     because you do not have to remember to specify /W0.
  646.  
  647.     In Version 2.5, if the /A switch is not included, the prompt will be dis- 
  648.     played in such a manner that ANSI sequences can be used for screen con- 
  649.     trol.  This restores compatibility with Version 2.2 for prompting and 
  650.     using ANSI screen control sequences.  The "prompt" will always be sent to  
  651.  
  652.  
  653.   GET 2.5                           SWITCHES                           Page 11
  654.  
  655.     the screen even if standard output is redirected with DOS redirection (>). 
  656.     Without /A the prompt can be as long as will fit on the DOS command or 
  657.     BATch line which is limited to 128 characters total.  With /A, the prompt 
  658.     is limited to 79 characters.
  659.  
  660.   /B flush keyboard Buffer.  Useful to flush any type-ahead keystrokes when 
  661.     asking for user input.
  662.  
  663.   /C tells GET to handle Ctrl-C and Ctrl-Break instead of letting DOS do it. 
  664.     It has the same effect as the old Alt-253 which has been retained for com- 
  665.     patibility.  The switch is preferred.  See the GET USER INPUT section for 
  666.     additional details.
  667.      Example: GET SE "Enter your password: " /C.
  668.   Caution: The old Alt-253 surrogate will be eliminated in future versions.
  669.  
  670.   /E specifies that keystrokes will be read from the Enhanced keyboard.  This 
  671.     has the same effect as the old surrogate for the enhanced keyboard, Alt- 
  672.     254, which has been retained for compatibility in this version.  /E only 
  673.     affects the C, N, I, and T commands.  Also, note the discussion of the 
  674.     handling of the extended and enhanced keys by using scan codes and upper 
  675.     ASCII characters.
  676.       Example: GET C "Enter F11 to continue: " Θ /E
  677.   Caution: The old enhanced surrogate will be eliminated in future versions.
  678.  
  679.   NOTE: Extended keys are those with no ASCII representation, such as the 
  680.     function and cursor keys.  Enhanced keys are keys on the enhanced keyboard 
  681.     which do not appear on older keyboard layouts, such as F11 and F12.
  682.  
  683.   /L specifies that the string that is written to the Environment is to be 
  684.     forced into lower case.  Any ASCII-255 characters will be "lowercased" to 
  685.     the ASCII space character.  Strings with spaces in them will not test 
  686.     properly with the BATch IF subcommand.  Also: see /U for Uppercase.
  687.      Example: GET SE "Enter your password: "  /C /L
  688.  
  689.   /M tells GET to try to put the string in the master environment instead of 
  690.     the child environment.  If the BATch file is being run from a secondary 
  691.     shell, GET will bypass the environment of the secondary command processor 
  692.     and look for the master environment.  This works exactly like the old GET 
  693.     Z, and it makes GET Z more flexible.  Without /M, GET Z will put the 
  694.     quoted string into the first command processor environment that it finds. 
  695.     If you want GET Z to work like it did in Version 2.2, you must add the /M 
  696.     switch.  The advantage is that /M can be used with any GET command.  If 
  697.     you need more information about the different environment areas see the 
  698.     section on ENVIRONMENT AND SHELLS.
  699.       Example: GET Z "Put this string in the master environment" /M
  700.  
  701.   Caution: Finding the master environment is not a documented feature of DOS, 
  702.     and there is no guarantee that /M will work under all conditions.  For ex- 
  703.     ample, don't expect it to work if the command processor is running in a 
  704.     DESQview window or under Windows, and it may cause the system to hang.  If 
  705.     you need this capability, be sure to test it under all possible conditions 
  706.     before relying on it.
  707.  
  708.   /TR and /TL trim blanks from the string that is written to the environment. 
  709.     Trim works with S, SE, Z, ZE, and HE.  /TR or /T+ will trim blanks from 
  710.     the right or trailing end of the string, while /TL or /T- will trim blanks 
  711.     from the left or leading end of the string.  Both switches may be used in 
  712.     the same command if desired.
  713.  
  714.  
  715.   Page 12                           SWITCHES                           GET 2.5
  716.  
  717.  
  718.   /U specifies that the string that is written to the Environment is to be 
  719.     forced into upper case (Caps).  Any spaces will be "uppercased" to ASCII 
  720.     255 so that the string can be tested with the BATch IF subcommand.  /U is 
  721.     not necessary with the C, N, I, or T commands.  Also: see /L for Lower- 
  722.     case.
  723.      Example: GET SE "Enter your password: "  /C /U
  724.  
  725.   /Vvar= lets you specify a name for the Environment variable to be used in 
  726.     place of "GET".  This can eliminate some BATch file lines that would be 
  727.     used to save the GET variable under another name with the SET command. 
  728.     The name must be contiguous with the V in /V and should be terminated with 
  729.     the = sign.  Although the '=' sign is optional, the name must be 
  730.     terminated in some way, and the '=' sign is the recommended method.  How- 
  731.     ever, any one of the following characters will serve as the terminating 
  732.     delimiter for the name: =, space, /, or carriage return (indicating the 
  733.     end of the command line or BATch file line).  Lowercase letters will be 
  734.     coerced to uppercase before placing the name in the Environment.  The fol- 
  735.     lowing example will establish an Environment variable that will show up as 
  736.     DEMO= instead of the default name GET=.
  737.       Example (old method): GET C "Enter the drive letter: " ABCD
  738.                             set DEMO=%GET%
  739.       Example (new method): GET C "Enter the drive letter: " ABCD /vdemo=
  740.  
  741.   CAUTION:  If you modify BATch files to take advantage of the convenience of 
  742.     the /V switch, be sure you adjust all references to the %GET% variable in 
  743.     subsequent statements to reflect the new variable name.
  744.  
  745.   /V- completely suppresses creating the Environment variable under any name. 
  746.     No changes to the Environment will be made.  This is useful when the 
  747.     result is of no interest, or when all the information required can be ob- 
  748.     tained from the ErrorLevel.  This may be useful at times when there is in- 
  749.     sufficient free space in the Environment, or when there is reluctance to 
  750.     create an Environment variable which might overwrite one that is already 
  751.     there.
  752.  
  753.   NOTE: A side effect of /V- is that SET GET?=ON will have no effect.  Since 
  754.     the search of the Environment is being completely bypassed, GET cannot 
  755.     check for the GET? variable.
  756.  
  757.   /W has different meanings for different commands.  In general it is always 
  758.     used to input a number for use by the command.  When getting user keyboard 
  759.     input, /W is used to specify a number of seconds to wait.  In other com- 
  760.     mands the number has other meanings and uses.  See the description of the 
  761.     command for further details.
  762.  
  763.     NOTE: /Wnnnn is a general replacement for the old #nnnn notation.  /W can 
  764.     and should be used wherever the # notation was previously valid.  The # 
  765.     notation will disappear in future versions.
  766.  
  767.   /X provides eXtra functionality for a command.  It has different meanings 
  768.     depending on the command being used.  When getting keyboard input, /X 
  769.     specifies that extended keys will be accepted. /X also is used to specify 
  770.     hexadecimal output for the GET F (file size) command, and for other pur- 
  771.     poses with other commands.  See GET F or the specific command for further 
  772.     details.
  773.  
  774.  
  775.  
  776.   GET 2.5                           SWITCHES                           Page 13
  777.  
  778.   /~ is a temporary switch that is used with GET S only.  Previously, if the 
  779.     user pressed Esc when you asked for a string, GET S would return 0 as if 
  780.     the user had not entered anything (i.e., just pressed Return).  A more 
  781.     useful feature that has been suggested is for GET S to return the Environ- 
  782.     ment and ErrorLevel codes for the Escape surrogate.  That way the program- 
  783.     mer can determine whether the user entered nothing or Escaped. The /~ 
  784.     switch, when used with GET S, will turn on this new feature.
  785.  
  786.  
  787.  
  788.   Page 14                        Get User Input                        GET 2.5
  789.  
  790.   USING GET COMMANDS
  791.  
  792.   The description of GET commands is subdivided into the following sections of 
  793.     this manual.
  794.  
  795.       String Handling and Screen I/O
  796.       DISK and FILE Information
  797.       MEMORY and SYSTEM Information
  798.  
  799.   STRING HANDLING AND SCREEN I/O
  800.  
  801.   The commands C, N, S, Z, T, I, H, U, R, B, and V pertain to obtaining key- 
  802.     board input from the user, moving and modifying text strings, and getting 
  803.     and setting screen attributes.  These commands take 0, 1, or 2 arguments 
  804.     as shown on the HELP SCREEN, and can make use of many of the switches.
  805.  
  806.     "prompt"  refers to an arbitrary character string that will be displayed 
  807.       on the screen to coach the user as to what type of input is expected. If 
  808.       a prompt is used, it must be enclosed in double quotes.  Prompts can be 
  809.       displayed in reverse video or in color with the /A switch.
  810.  
  811.     NOTE: The "prompt" can be used to issue ANSI.SYS screen control escape se- 
  812.       quences.  It is more convenient to use GET to do this, than to make 
  813.       changes to the DOS PROMPT and have to reset PROMPT, especially if the 
  814.       BATch file is going to be run on various computer systems that may use 
  815.       different prompts.  Do not use /A when you want ANSI.SYS or one of its 
  816.       clones to see the prompt.  If any form of /A is specified, GET uses a 
  817.       different method of displaying the prompt which bypasses ANSI.SYS.  Note 
  818.       also, that when /A is used, the maximum length of the prompt is 79 
  819.       characters.  Longer prompts will be truncated to 79 characters.  Without 
  820.       /A the prompt can be longer, limited only by the maximum length of a 
  821.       BATch file line which in most versions of DOS is 128 characters.
  822.  
  823.     pattern is a special case of chars in which certain characters have spe- 
  824.       cial meanings.  See the S command for detailed information.
  825.  
  826.     chars -- also see char information above -- are ASCII character strings 
  827.       which cannot include the space character, but may include surrogates. If 
  828.       any chars are given, user input will be limited to the characters in the 
  829.       character string including those indicated by the surrogates. If no 
  830.       chars are given, any key stroke will be accepted. To indicate that a 
  831.       carriage return, Esc, or space is acceptable, include the surrogate 
  832.       character listed above.  CR and Esc will return 125 and 126 in the Er- 
  833.       rorLevel respectively, and the surrogate character in the Environment. 
  834.       Space will return 255 and Alt-255 if the characters are converted to up- 
  835.       percase.  Uppercase is automatic with C, N, I, and T, or when the /U 
  836.       switch is used.  It can be defeated with the /L switch.  Think of ASCII 
  837.       255 as an upper-case Space for purposes of GET input.
  838.  
  839.     Switches:
  840.  
  841.     /E specifies that Enhanced keyboard keys will be accepted. If you use /E, 
  842.       the BIOS function for the enhanced keyboard will be used.  This permits 
  843.       the recognition of F11 and F12 as well as other enhanced and extended 
  844.       keyboard keys.  /E should not be used unless you are sure that all users 
  845.       of your BATch file will be using enhanced keyboards because it absolute- 
  846.       ly does not work on machines with older BIOS's that do not recognize the 
  847.       enhanced keyboard interrupt.
  848.  
  849.  
  850.   GET 2.5                        Get User Input                        Page 15
  851.  
  852.  
  853.     /X specifies that extended keys will be accepted. This has the same effect 
  854.       as the old surrogate for extended keys, "{", which has been retained 
  855.       (but see below) for compatibility.  /X is used in the same manner as /E, 
  856.       but will not recognize F11, F12 or other enhanced keys.
  857.         Example: GET C "Enter F1 to continue: " ƒ /X
  858.  
  859.       If extended or enhanced keyboard characters are specified with /X or /E 
  860.       (you don't need both) the scan code plus 100 will be in the ErrorLevel 
  861.       and the corresponding upper ASCII character in the Environment.  A table 
  862.       of keyboard scan codes is included in the file SCANCODE.DOC.
  863.  
  864.       The extended and enhanced scan codes are mapped to the upper ASCII table 
  865.       by adding 100 to the scan code.  For example, the scan code for F1 is 
  866.       59.  If extended keys are allowed, the upper ASCII character 159, "ƒ", 
  867.       will limit extended keystrokes to just the F1 key.  Scan codes of 28 
  868.       through 150 are recognized as the upper ASCII surrogates 128 through 
  869.       250.  A table of scan and ASCII codes is included in the file SCAN- 
  870.       CODE.DOC with the registered version.  One method of entering the upper 
  871.       ASCII characters is by using the Alt-NumPad feature of DOS.
  872.  
  873.       There are some caveats that go along with this extended key scheme.
  874.  
  875.        1. If you want extended and/or enhanced keys to be recognized, you must 
  876.           include either the old surrogate or the new switch for those keys. 
  877.           The switch is the preferred method as the surrogate will be discon- 
  878.           tinued in a future version.  The upper ASCII characters will not be 
  879.           recognized as surrogates for the extended keys unless the switch or 
  880.           the surrogate is included.
  881.  
  882.        2. If you use the old surrogate, it must come after all individual key 
  883.           specifications (if any) including the surrogates for CR and Esc.
  884.  
  885.        3. If you specify any individual keys at all, then you must specify all 
  886.           keys that you want to allow.  The following will not do what appears 
  887.           to be intended:
  888.               GET C "Press x or any function key: "  x /X
  889.           In this example, only the X key will be accepted even though the /X 
  890.           switch is included.  A better example is:
  891.               GET C "Press x or F1: "  xƒ /X
  892.           or equivalently but not preferred:
  893.               GET C "Press x or F1: "  xƒ{
  894.  
  895.        4. Also note that the mapping of extended keys for GET U is not the 
  896.           same as for GET C.
  897.  
  898.     /C Break: The /C switch will suppress DOS Control-C and Ctrl-Break hand- 
  899.       ling.  It applies only to the S, C, and N commands.  Ctrl-Break handling 
  900.       works a bit differently according to whether you have specified a wait- 
  901.       ing time or not.  If no timeout has been specified, Ctrl-Break will just 
  902.       cause a beep.  If a timeout has been specified, and the first keystroke 
  903.       is Ctrl-Break, then GET will simulate a timeout with an ErrorLevel of 0, 
  904.       the same ErrorLevel you would check for to see if there was a timeout. 
  905.       If any character is entered, the timeout is cancelled, and Ctrl-Break is 
  906.       handled as if there is no timeout.  For single character input, Ctrl-C 
  907.       will return the value and character 3 <''> if all characters are al- 
  908.       lowed (no chars string), or a beep if specific chars are specified. 
  909.       This provides versatility in break handling, but some experimentation 
  910.       would be a good idea to become familiar with the methods.
  911.  
  912.  
  913.   Page 16                        Get User Input                        GET 2.5
  914.  
  915.  
  916.     /W[nnnn] The number nnnn following /W will be used to establish the number 
  917.       of seconds to wait for the first key stroke to be entered.  If timeout 
  918.       takes place with nothing entered, the ErrorLevel will be 0, and there 
  919.       will be no GET variable in the Environment.  If /W is omitted, GET will 
  920.       wait forever.  If a wrong key is pressed the timeout is cancelled.
  921.         Example: GET C "Answer Yes or No: " YN /W20
  922.       will wait 20 seconds for a character to be entered.  If none are entered 
  923.       in that time, GET will exit with 0.  If a wrong character (not Y or N) 
  924.       is entered, GET will wait until a correct character is entered regard- 
  925.       less of the time. The default if /W is omitted is interpreted to mean 
  926.       wait forever.
  927.  
  928.     NOTE: /W has the same effect as the old #num syntax, which is retained in 
  929.       this version for compatibility.
  930.         Example(old method): GET C "Enter F1 to continue: " ƒ#20 /X
  931.         Example(new method): GET C "Enter F1 to continue: " ƒ /X /W20
  932.       Caution, the old #nnn syntax will be eliminated in future versions.
  933.  
  934.     /W0 or /W with no number indicates no wait.  The prompt will be displayed, 
  935.       and GET will immediately exit with ErrorLevel 0.  This is useful to 
  936.       "echo" text in reverse video or in color with the /A switch.  If a 
  937.       character is ready in the keyboard buffer due to a type-ahead, GET C, T, 
  938.       and N will read that character.  If it was a valid character for the 
  939.       command, it will be reported as a valid character for the command.
  940.  
  941.     /L will convert any uppercase Environment characters to lowercase.  For 
  942.       get C, T, and N, the ErrorLevel will still represent the ASCII code for 
  943.       the uppercase character, and the Echo, if any, will be the uppercase 
  944.       character.
  945.  
  946.     General: The C, N, I, and S commands read characters using a BIOS call so 
  947.       they bypass Standard Input and most keyboard redefinition methods (mac- 
  948.       ros).  The old "surrogate" methods for Ctrl-Break, Extended, and En- 
  949.       hanced keys are supported in Release 2.5 for compatibility, but will not 
  950.       be supported in future versions.
  951.  
  952.       IMPORTANT: Please remember that the special ASCII characters '<', '>', 
  953.       and '|' are DOS redirection characters and you cannot use them as 
  954.       characters in BATch files.  4DOS also uses '^' and the grave accent 
  955.       (back quote) as special characters so they should not be used unless you 
  956.       know that no users of your BATch file will be running 4DOS or NDOS in- 
  957.       stead of COMMAND.COM.  Single keystrokes for C, N or T are acted on 
  958.       without pressing Enter. (String input, of course, will require the user 
  959.       to press Enter.)
  960.  
  961.       When a character is entered by the user in response to C, N, or T, it is 
  962.       compared with the list of valid chars (if any).  This validation of 
  963.       characters is not case sensitive.  That is, if the user enters a lower- 
  964.       case letter it will be converted to uppercase and the chars will also be 
  965.       converted to uppercase if necessary before any validation comparisons 
  966.       are made.
  967.  
  968.       When checking for string matching with the MS DOS BATch IF subcommand, 
  969.       remember that it is case sensitive. Different versions of DOS handle
  970.         IF "string1"=="string2"
  971.  
  972.  
  973.   GET 2.5                        Get User Input                        Page 17
  974.  
  975.       somewhat differently, and there have been several "bugs" reported in one 
  976.       version or another.  Try to test any such constructs under several DOS 
  977.       versions including DR DOS and 4DOS/NDOS if possible.  In some versions 
  978.       the string cannot contain any spaces.  The test under 4DOS is not case 
  979.       sensitive, and it can contain spaces if the strings are enclosed in dou- 
  980.       ble quotation marks.  Only 4DOS does it right.
  981.  
  982.  
  983.   Page 18                          GET Character                         GET C
  984.  
  985.     GET C                                                        Get Character
  986.  
  987.     Syntax: GET C[E] ["prompt"] [chars] [/switches]
  988.     Input:  "prompt" to be displayed.
  989.             chars to specify the acceptable characters that can be entered.
  990.             /switches - /A /W /C /M /E /X /V /L
  991.     Output: ErrorLevel - ASCII or surrogate scan code.
  992.             Environment - character
  993.  
  994.     C is short for "Character".  GET C obtains a single character from the 
  995.       user and does not wait for a carriage return <CR> to be pressed.  As 
  996.       soon as the user presses a key, GET immediately evaluates the key that 
  997.       was pressed. The keystroke will be echoed to the screen to provide the 
  998.       user with feedback on the key that was pressed. If the keystroke is an 
  999.       alphabetic character (letter) it will be converted to uppercase if 
  1000.       necessary, although the echo will be the actual letter typed in by the 
  1001.       user.  The storage of the letter in uppercase can be reversed with the 
  1002.       /L switch for lowercase.
  1003.  
  1004.     GET CE is a special case in which the character is not echoed to the 
  1005.       screen.  This might be useful if the character represents a password or 
  1006.       other secret symbol that must be held confidential and hidden from the 
  1007.       eyes of casual observers, or if the character entered has no special 
  1008.       significance as with the PAUSE command.
  1009.  
  1010.     In its simplest form, GET C, no prompt is issued and any keystroke except 
  1011.       extended keys will be accepted.  The BATch file will simply pause until 
  1012.       a key is pressed.  However, the user should be given some indication of 
  1013.       what is expected, and the prompt provides a convenient means to do so. 
  1014.       For example, you can emulate the DOS PAUSE subcommand with the following 
  1015.       command.
  1016.  
  1017.     GET C "Press a key when ready . . ."
  1018.  
  1019.     This is more convenient than the PAUSE subcommand because the prompt can 
  1020.       be anything you want it to be such as "Press a key when you want to con- 
  1021.       tinue . . .".  As with the PAUSE command, it can be preceded in the 
  1022.       BATch file with ECHO statements giving more information as to what the 
  1023.       pause is for.  It is also more useful with the /A switch to control the 
  1024.       attribute, and/or the /W switch to control the pausing time.
  1025.  
  1026.     The optional argument [chars] is a single string of characters that limit 
  1027.       the acceptable user input.  Any other character entered will produce a 
  1028.       beep, and GET will wait for another character.  In addition to the com- 
  1029.       mon alphanumeric keyboard characters, special characters can be indi- 
  1030.       cated as discussed above under Surrogates and Extended Characters.  If 
  1031.       the /C switch is included, the user will not be able to exit by pressing 
  1032.       Ctrl-Break, and Ctrl-C will be treated like any other character; i.e. if 
  1033.       any chars are specified, then Ctrl-C will not be allowed because it can- 
  1034.       not be specified, but if no chars are specified then Ctrl-C will return 
  1035.       ASCII 3.  Ctrl-C is ASCII 3 and will be indicated by the number 3 in the 
  1036.       ErrorLevel and the ASCII character for 3, the heart, in the Environment.
  1037.  
  1038.     EXAMPLES:
  1039.  
  1040.     1. To issue a message and wait for a key to be pressed similar to the DOS 
  1041.       PAUSE subcommand:
  1042.  
  1043.  
  1044.  
  1045.   GET C                          GET Character                         Page 19
  1046.  
  1047.     ECHO Make sure your printer is turned on.
  1048.     GET C "Press a key when ready . . ."
  1049.  
  1050.     2. To present a simple menu and let the user make a selection.  The /C 
  1051.       switch indicates suppression of the Control-Break keystroke.  Neither 
  1052.       Control-C nor Control-Break will be accepted.
  1053.  
  1054.     :MENU
  1055.     ECHO A Word Processor
  1056.     ECHO B Spreadsheet
  1057.     ECHO C Database
  1058.     GET C "Select A, B, or C: " ABC /C
  1059.     IF "%GET%"=="A" GOTO WP
  1060.     IF "%GET%"=="B" GOTO SS
  1061.     IF "%GET%"=="C" GOTO DB
  1062.     GOTO MENU
  1063.     :WP
  1064.     Rem Call your word processor here
  1065.     GOTO MENU
  1066.     :SS
  1067.     Rem Call your spread sheet here
  1068.     GOTO MENU
  1069.     :DB
  1070.     Rem Call your database manager here
  1071.     GOTO MENU
  1072.  
  1073.     3. To illustrate the use of surrogates. The empty space between } and ~ is 
  1074.       the ASCII 255 character entered with Alt-255, not the regular space 
  1075.       character.  The /W20 waits 20 seconds for a response.  /A will cause the 
  1076.       prompt to be displayed in reverse video.
  1077.  
  1078.     :START
  1079.     GET C "Press <CR>, space bar, or Esc: " } ~ /W20 /A
  1080.     IF ErrorLevel 255 GOTO SPACE
  1081.     IF ErrorLevel 126 GOTO ESCAPE
  1082.     IF ErrorLevel 125 GOTO RETURN
  1083.     GOTO START
  1084.     :SPACE
  1085.     Echo The space bar was pressed.
  1086.     GOTO END
  1087.     :ESCAPE
  1088.     Echo The Escape key was pressed.
  1089.     GOTO END
  1090.     :RETURN
  1091.     Echo The Enter key was pressed.
  1092.     :END
  1093.  
  1094.     4. Same example as 3 using the Environment variable instead of the Error- 
  1095.       Level.  Note that " " is ASCII 255 in double quotes, not the regular 
  1096.       space character.  As above, the /W20 switch will wait for 20 seconds 
  1097.       then continue, but since none of the valid characters will be in the 
  1098.       %GET% variable, the next 3 lines will fall through and the GOTO START 
  1099.       line will cause a loop back to :START for another 20 second wait.
  1100.  
  1101.  
  1102.  
  1103.   Page 20                          GET Character                         GET C
  1104.  
  1105.     :START
  1106.     GET C "Press <CR>, space bar, or Esc: " } ~ /W20
  1107.     IF "%GET%"==" " GOTO SPACE
  1108.     IF "%GET%"=="~" GOTO ESCAPE
  1109.     IF "%GET%"=="}" GOTO RETURN
  1110.     GOTO START
  1111.     :SPACE
  1112.     Echo The space bar was pressed.
  1113.     GOTO END
  1114.     :ESCAPE
  1115.     Echo The Escape key was pressed.
  1116.     GOTO END
  1117.     :RETURN
  1118.     Echo The Enter key was pressed.
  1119.     :END
  1120.  
  1121.  
  1122.   GET N                        GET yes/no aNswer                       Page 21
  1123.  
  1124.     GET N                                                    Get yes/no aNswer
  1125.  
  1126.     Syntax: GET N[E] ["prompt"] [/switches]
  1127.     Input:  "prompt" to be displayed.
  1128.             /switches - /A /W /C /M /V /L
  1129.     Output: ErrorLevel - ASCII or surrogate code.
  1130.             Environment - character
  1131.  
  1132.     GET N is a special case of C that will accept only y, n, carriage return, 
  1133.       or Esc.  The Ctrl-C suppression and the number of seconds switches to 
  1134.       wait may be specified, but no [chars] argument will be recognized. The 
  1135.       syntax rules for GET C apply to GET N.  The only purpose for GET N is 
  1136.       just to make programming yes/no answers a bit simpler than using GET C 
  1137.       and having to always specify the YN and surrogate characters.
  1138.  
  1139.     EXAMPLES:
  1140.  
  1141.     1. The following two statements are functionally identical:
  1142.  
  1143.     GET N "Answer yes or no (y/n): "
  1144.     GET C "Answer yes or no (y/n): " YN}~
  1145.  
  1146.     2. Using ErrorLevel.  89 is the ASCII code for Y, 78 is the ASCII code for 
  1147.       N, 125 is the code for the Carriage Return surrogate, and 126 for the 
  1148.       Escape surrogate.  This example also illustrates a method of using the 
  1149.       Environment for defining variables where the value of GET is redefined 
  1150.       according to what the ErrorLevel was from the Yes/No question.  The 
  1151.       resulting value of %GET% is used in the message Echoed in the last line.
  1152.  
  1153.     GET N "Answer yes or no (y/n): "
  1154.     IF ErrorLevel 126 GOTO ESCAPE
  1155.     IF ErrorLevel 125 GOTO RETURN
  1156.     IF ErrorLevel 89 GOTO YES
  1157.     IF ErrorLevel 78 GOTO NO
  1158.     SET GET=Break
  1159.     GOTO END
  1160.     :ESCAPE
  1161.     SET GET=Escape
  1162.     GOTO END
  1163.     :RETURN
  1164.     SET GET=Return
  1165.     GOTO END
  1166.     :YES
  1167.     :NO
  1168.     :END
  1169.     Echo The %GET% key was pressed.
  1170.  
  1171.     3. Same example as 2.  This time the Environment is used instead of the 
  1172.       ErrorLevel.  Since we are not using Control-C suppression, it is pos- 
  1173.       sible to break out of the BATch file with Control-C or Control-Break in 
  1174.       this and the previous example. Remember that in many versions of DOS the 
  1175.       IF subcommand is case sensitive.  GET N converts all alphabetic charac- 
  1176.       ters to uppercase, so always use uppercase comparison unless you are 
  1177.       using the /L switch.
  1178.  
  1179.  
  1180.  
  1181.   Page 22                        GET yes/no aNswer                       GET N
  1182.  
  1183.     GET N "Answer yes or no (y/n): "
  1184.     IF "%GET%"=="~" GOTO ESCAPE
  1185.     IF "%GET%"=="}" GOTO RETURN
  1186.     IF "%GET%"=="Y" GOTO YES
  1187.     IF "%GET%"=="N" GOTO NO
  1188.     SET GET=Break
  1189.     GOTO END
  1190.     :ESCAPE
  1191.     SET GET=Escape
  1192.     GOTO END
  1193.     :RETURN
  1194.     SET GET=Return
  1195.     GOTO END
  1196.     :YES Put your code for Yes on lines after this label.
  1197.     GOTO END
  1198.     :NO  Put your code for No on lines after this label.
  1199.     :END
  1200.     Echo The %GET% key was pressed.
  1201.  
  1202.  
  1203.   GET T                           Moving Text                          Page 23
  1204.  
  1205.     GET T                                                          Moving Text
  1206.  
  1207.     Syntax: GET T[E] "filespec" [chars] [/switches]
  1208.     Input:  file specification containing moving text to be displayed.
  1209.             chars to specify the acceptable characters that can be entered.
  1210.             /switches - /M /V /L
  1211.     Output: ErrorLevel - ASCII or surrogate scan code.
  1212.             Environment - character
  1213.  
  1214.     GET T is another special case of GET C which provides a special effect. 
  1215.       The prompt information is presented as a moving line of text across the 
  1216.       bottom of the screen.  This permits having prompt strings up to 4096 
  1217.       characters long, and the motion of the characters helps to catch the 
  1218.       users attention.  T requires a file with the prompt string which will be 
  1219.       displayed moving across the bottom line of the screen. Currently only 
  1220.       standard 25 line screens are supported.  The text file should be plain 
  1221.       ASCII without any control characters (No CR, LF, or any other characters 
  1222.       below ASCII 32).  To be effective the prompt must be over 80 or more 
  1223.       characters long, and to ensure smooth wrap-around the first 79 charac- 
  1224.       ters should be repeated at the end.  The maximum length for the text of 
  1225.       the moving prompt is 4096 characters.  Over that it will be truncated. 
  1226.       T does not accept a number of seconds-to-wait argument at this time so 
  1227.       it will wait until a valid key is pressed.
  1228.  
  1229.     The T command can fail with an "Invalid Command" message if the file is 
  1230.       not properly specified and cannot be found, or if the prompt string is 
  1231.       less than 80 characters.  An ErrorLevel of zero should be tested to 
  1232.       determine if the command was successful (see example 2 below).  A prompt 
  1233.       string of exactly 80 characters will remain stationary.
  1234.  
  1235.     The question has been asked as to how to go about creating such a long 
  1236.       prompt string without carriage returns or other control characters. 
  1237.       Many text editors have the capability to do this by turning off word 
  1238.       wrap.  A good text editor will let you do just about anything you want 
  1239.       to do with ASCII text.  Most programmers use a text editor instead of a 
  1240.       word processor while creating and editing their code. Many word pro- 
  1241.       cessors will let you use them as text editors by specifying "non- 
  1242.       document" mode as appropriate.  As with many things related to program- 
  1243.       ming, trial and error experimentation is often the order of the day. 
  1244.       Sometimes it is called "hacking".
  1245.  
  1246.     EXAMPLES:
  1247.  
  1248.     1. If there is a file on the GET disk named SAMPLE.TXT, enter the follow- 
  1249.       ing command to see the moving text effect:
  1250.  
  1251.     GET T "SAMPLE.TXT"
  1252.  
  1253.     2.  Example 2 for GET C can easily be modified to use a moving text prompt 
  1254.       by changing GET C to GET T and replacing the prompt with the filename as 
  1255.       follows.  The timeout option is not effective with GET T.
  1256.  
  1257.  
  1258.  
  1259.   Page 24                           Moving Text                          GET T
  1260.  
  1261.     :START
  1262.     GET T "sample.txt" } ~
  1263.     IF NOT ErrorLevel 1 GOTO END
  1264.     IF ErrorLevel 255 GOTO SPACE
  1265.     IF ErrorLevel 126 GOTO ESCAPE
  1266.     IF ErrorLevel 125 GOTO RETURN
  1267.     GOTO START
  1268.     :SPACE
  1269.     Echo The space bar was pressed.
  1270.     GOTO END
  1271.     :ESCAPE
  1272.     Echo The Escape key was pressed.
  1273.     GOTO END
  1274.     :RETURN
  1275.     Echo The Enter key was pressed.
  1276.     :END
  1277.  
  1278.     In this example note the addition of the line IF NOT ErrorLevel 1 GOTO 
  1279.       END. If the named file is not found due to not being in the current 
  1280.       directory, or not having the correct path or name specified, then GET 
  1281.       will report "Invalid Command" and exit with ErrorLevel 0.  The added 
  1282.       statement is a check for ErrorLevel equal 0, and should always be in- 
  1283.       cluded when using the GET T command.  You may include drive and path 
  1284.       with the filename, but GET must be able to find it where it is specified 
  1285.       to be.
  1286.  
  1287.  
  1288.   GET S                           GET String                           Page 25
  1289.  
  1290.     GET S                                                           Get String
  1291.     Syntax: GET S[E] ["prompt"] [pattern] [/switches]
  1292.     Input:  "prompt" to be displayed.
  1293.             pattern to control character entry
  1294.             /switches - /A /W /C /M /V /U /~ /L
  1295.     Output: ErrorLevel - length of string entered.
  1296.             Environment - string.
  1297.  
  1298.     S accepts character string input terminated by a carriage return. SE is 
  1299.       the same but does not echo user input to the screen.  The latter is use- 
  1300.       ful for hiding the entry of a password, for example.  Extended and en- 
  1301.       hanced keys will not be accepted, but break can be suppressed with /C. 
  1302.       The length of the string entered is returned in ErrorLevel.  If the user 
  1303.       presses Esc, GET will exit with 0 in ErrorLevel as if a timeout has oc- 
  1304.       curred unless the /~ switch is specified as described below.
  1305.  
  1306.     As with GET C, the prompt will be issued and then GET will wait with the 
  1307.       cursor on the same line as the prompt for keyboard input.  If a /W is 
  1308.       specified, GET will wait the specified number of seconds for the first 
  1309.       key to be pressed, then exit with an ErrorLevel of 0 if no key has been 
  1310.       pressed.  If any key is pressed during the waiting period, the wait is 
  1311.       cancelled and GET waits for the user to press the Carriage Return (En- 
  1312.       ter) key.
  1313.  
  1314.     The /~ switch modifies the result if Escape is pressed.  If the Escape ac- 
  1315.       tion switch is specified as /~, when Esc is pressed GET will exit and 
  1316.       leave the Esc surrogate <~> in the Environment and 126 in ErrorLevel. 
  1317.       This permits testing whether it was in fact a timeout or if the user 
  1318.       pressed the Escape key.  The /~ switch is needed as a compatibility fea- 
  1319.       ture.  Without it, GET S will work as it did in Release 2.2.
  1320.  
  1321.     The length of a string for the S command can be controlled by creating a 
  1322.       pattern of characters equal in number to the maximum length of the 
  1323.       string allowed.  If the argument is omitted the default is 79 charac- 
  1324.       ters.  A beep will be sounded if the maximum length has been reached and 
  1325.       more characters are attempted, or if any characters do not match the 
  1326.       specified pattern.
  1327.  
  1328.     The pattern in the argument specifies the acceptable characters for each 
  1329.       position as follows.  Note that the uppercase characters T, A, and Z 
  1330.       will cause lowercase characters to be converted to uppercase.  Conver- 
  1331.       sions to uppercase will also cause the space character to be converted 
  1332.       to ASCII 255.  This will facilitate BATch file checking with the IF sub- 
  1333.       command.
  1334.            tT - any typeable character,     T - a-z will be uppercased.
  1335.            aA - any alphabetic character,   A - a-z will be uppercased.
  1336.            zZ - any alphanumeric character, Z - a-z will be uppercased.
  1337.             9 - any digit 0-9.           Alt-255 - space character only.
  1338.            Any other character must match the character entered exactly.
  1339.  
  1340.     In a sense you can think of Alt-255 as an uppercase space character.  Re- 
  1341.       member that the regular ASCII space is used as a delimiter so the scan- 
  1342.       ning of the pattern stops if an embedded space is encountered.  If you 
  1343.       need to specify the space, use the surrogate Alt-255, otherwise use t or 
  1344.       T if a space is permitted.  If you are going to test the input with the 
  1345.       DOS IF subcommand use Alt-255 or T.  This will cause the space to be 
  1346.       converted to an Alt-255 which can be tested.  Unless you are using 4DOS,  
  1347.  
  1348.  
  1349.   Page 26                           GET String                           GET S
  1350.  
  1351.       if you try to test a string which contains a space with IF, you will get 
  1352.       the message "Bad command or file name", even with MS DOS 5.0.  This is 
  1353.       because COMMAND.COM stops parsing the string when it encounters a space 
  1354.       which it considers to be a delimiter even if it is enclosed in quotes.
  1355.  
  1356.     EXAMPLES:
  1357.  
  1358.     1. The following example lets the user type in any characters up to a 
  1359.       limit of 79.  The string that is typed in will be in the Environment, 
  1360.       and the length of the string in the ErrorLevel.  Because the /~ switch 
  1361.       is used, if the user presses Esc, the Escape surrogate "~" will be in 
  1362.       the Environment and 126 in the ErrorLevel.  If the user presses Ctrl-C 
  1363.       or Ctrl-Break, DOS will break out of GET with no change to the GET vari- 
  1364.       able in the environment, and an undefined value in the ErrorLevel, pos- 
  1365.       sibly 3 for Ctrl-C..  For this reason it is a good idea to clear the GET 
  1366.       variable with the statement SET GET= before issuing the GET S command, 
  1367.       or use /C to suppress Ctrl-Break as in the next example.  The /U switch 
  1368.       causes lowercase characters in the string to be converted to uppercase 
  1369.       to facilitate IF tests.
  1370.  
  1371.       GET S /U /~
  1372.  
  1373.     2. This example asks the user for a password.  It does not echo the entry 
  1374.       to the screen to keep the password secure from prying eyes.  It sup- 
  1375.       presses Ctrl-Break but allows the BATch file to check to see if the user 
  1376.       entered Escape.  The password is limited to 8 alphabetic or numeric 
  1377.       characters, and all alpha characters will be converted to uppercase to 
  1378.       facilitate testing.  The /a switch causes the error message to be dis- 
  1379.       played in reverse video, and the /w switch causes GET to immediately 
  1380.       exit after displaying the prompt.
  1381.  
  1382.     :START
  1383.     GET SE "Enter your password: " ZZZZZZZZ /C /~
  1384.     if "%GET%"=="~" goto Escape
  1385.     if "%GET%"=="PASSWORD" goto PWOK
  1386.     Rem Display error message in reverse video
  1387.     GET C "Incorrect Password" /a /w
  1388.     goto START
  1389.     :Escape
  1390.     GET N "Do you want to cancel your logon? "
  1391.     if NOT "%GET%"=="Y" goto START
  1392.     Echo Your logon is cancelled.
  1393.     goto EXIT
  1394.     :PWOK
  1395.     Echo Your logon has been accepted
  1396.     Rem Do whatever is necessary here to complete the logon.
  1397.     :EXIT
  1398.  
  1399.     3. The next example gives the user 30 seconds to respond.  If there is no 
  1400.       first name entered within 30 seconds, GET will beep and the BATch file 
  1401.       will cycle back to :START and ask the question again.  If there is a 
  1402.       timeout on last name, the BATch file will report that the session is 
  1403.       cancelled and exit.  Only alphabetic characters are allowed, and the 
  1404.       first character will be automatically capitalized.
  1405.  
  1406.  
  1407.  
  1408.   GET S                           GET String                           Page 27
  1409.  
  1410.     :START
  1411.     GET S "Enter your first name " Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /W30
  1412.     if NOT ErrorLevel 1 goto START
  1413.     SET FIRST=%GET%
  1414.     GET S "Enter your last name " Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa /W30
  1415.     if errorlevel 1 goto NAME
  1416.     Echo Your session is cancelled.
  1417.     Rem Do whatever is necessary to cancel session here.
  1418.     goto EXIT
  1419.     :NAME
  1420.     Echo Your name is %FIRST% %GET%
  1421.     :EXIT
  1422.  
  1423.  
  1424.   Page 28                        Check Key Buffer                        GET I
  1425.  
  1426.     GET I                                                     Check Key Buffer
  1427.     Syntax: GET I[E] "prompt"  [/switches]
  1428.     Input:  "prompt" to be displayed.
  1429.             /switches - /A /M /V /E /X
  1430.     Output: ErrorLevel - ASCII or surrogate scan code.
  1431.             Environment - character
  1432.  
  1433.     I checks to see whether a key has been pressed but it does not wait for a 
  1434.       keystroke if none is in the buffer; i.e. if the user has not pressed a 
  1435.       key in type-ahead mode.  The character that is waiting will be reported 
  1436.       in the same manner as for GET C, but it will remain in the keyboard 
  1437.       buffer.  If there is no character waiting, the ErrorLevel will be 0 and 
  1438.       GET or the variable specified with /V will be expunged from the Environ- 
  1439.       ment.
  1440.  
  1441.     IE will read the key if it is present and report it in the same manner as 
  1442.       C, or return 0 and expunge GET from the Environment if no character is 
  1443.       waiting.  The difference in the IE command from the C command is that IE 
  1444.       does not wait if no key is waiting.  If you specify a zero waiting time 
  1445.       for GET C with GET C /W or GET C /W0 it will be functionally equivalent 
  1446.       to GET IE.
  1447.  
  1448.     You can control whether Extended or Enhanced keys are to be included in 
  1449.       the same manner as for GET C.  A prompt can be included and will be dis- 
  1450.       played, which makes I useful to "echo" text to the screen like the DOS 
  1451.       ECHO command, but with GET you can specify reverse video or color at- 
  1452.       tributes.
  1453.  
  1454.     One way to make use of GET I is to allow a key to be pressed during boot- 
  1455.       up (or while any BATch file is running for that matter), then check to 
  1456.       see if a key has been pressed and take action accordingly, but if no key 
  1457.       was pressed there will be no delay.  Another use would be in a BATch 
  1458.       program that the user is familiar enough with that s/he may anticipate 
  1459.       the next question.  GET I could be used to check to see if the user has 
  1460.       answered the question before it was asked.
  1461.  
  1462.     EXAMPLES:
  1463.  
  1464.     1. In these examples a GET command (GET U), explained elsewhere, is used 
  1465.       to place a key in the keyboard buffer, then GET I checks to see if it is 
  1466.       there.  In this first example, the letter "a" is placed in the buffer 
  1467.       and GET I reports that "A" is waiting with ErrorLevel 65 and GET=A.  The 
  1468.       character "a" will remain in the buffer and will be available to the 
  1469.       next program that reads keyboard input.  In this case, neither extended 
  1470.       nor enhanced keys will be seen.
  1471.  
  1472.     Rem Simulate user pressing the "a" key.
  1473.     GET U "a"
  1474.     Rem Check to see if the key is in the buffer.
  1475.     GET I
  1476.     if ErrorLevel 1 goto ISTHERE
  1477.     Echo There is no key in the buffer.
  1478.     goto EXIT
  1479.     :ISTHERE
  1480.     Echo The key in the buffer is %GET%.
  1481.     :EXIT
  1482.     Rem Note that if you run this BATch file from the command line, you will
  1483.     Rem see "a" at the next DOS prompt when DOS reads the keyboard buffer.
  1484.  
  1485.  
  1486.   GET I                        Check Key Buffer                        Page 29
  1487.  
  1488.  
  1489.     2. Clearing the keyboard buffer.  By using the switch /E, both extended 
  1490.       and enhanced keys will be seen as well as all standard keys.  Do not use 
  1491.       /E unless you know that all users will have enhanced keyboards.   Note: 
  1492.       This example is for illustration only.  A faster method of clearing the 
  1493.       buffer is to use the /B switch.
  1494.  
  1495.     :LOOP
  1496.     GET IE /E
  1497.     if ErrorLevel 1 goto LOOP
  1498.  
  1499.     3. Suppose you would like to be able to do a clean boot without any TSR's 
  1500.       when you want to run a program such as a disk defragmenter.  You can 
  1501.       have GET I check if you have pressed a key, and skip your TSR's in your 
  1502.       AUTOEXEC.BAT if you have.
  1503.  
  1504.     GET IE
  1505.     if ErrorLevel 1 goto CONTINUE
  1506.     Rem Load first TSR here.
  1507.     Rem Load Second TSR here.
  1508.     Rem ...
  1509.     Rem Load Last TSR here.
  1510.     :CONTINUE with the rest of your AUTOEXEC.BAT
  1511.  
  1512.  
  1513.   Page 30                        Put String (Zap)                        GET Z
  1514.  
  1515.     GET Z                                                     Put String (Zap)
  1516.     Syntax: GET Z "string" [skip] [/switches]
  1517.     Input:  "string" to be placed in the Environment
  1518.             /switches - /M /V /U /L /W
  1519.     Output: ErrorLevel - length of string.
  1520.             Environment - string
  1521.  
  1522.     Z uses the "string" as input.  It will put the string into the Environment 
  1523.       as the value of the GET= or /Vvar= variable.  If you include the /M 
  1524.       switch, GET will attempt to bypass any secondary environments and put 
  1525.       the string in the master Environment.  By "master Environment" is meant 
  1526.       the environment of the original command processor that was loaded when 
  1527.       you started your computer, as contrasted with what we shall call the 
  1528.       "current" Environment defined as that of the command processor that is 
  1529.       running the BATch file.  The current Environment will be the same as the 
  1530.       master Environment unless a secondary command processor has been in- 
  1531.       voked. If GET is running under a secondary command processor, GET Z with 
  1532.       /M will attempt to bypass the current Environment of the secondary com- 
  1533.       mand processor and find the master environment.  In the latter case, the 
  1534.       GET variable will not be available to the current BATch file.  See dis- 
  1535.       cussion of Environment and Shells.
  1536.  
  1537.     If a numerical [skip] argument is specified, it will be taken to specify 
  1538.       the number of characters to skip over before transferring the remainder 
  1539.       of the string to the environment.  The /W switch can be used to specify 
  1540.       the maximum length of the string as described for GET ZE below.  Thus, 
  1541.       GET Z can be used to extract a substring from "string" starting with the 
  1542.       character after skip and using up to the number of characters specified 
  1543.       by /Wnnnn.  If [skip] is omitted the default is 0 meaning to start at 
  1544.       the beginning of the string.  NOTE: The use of /W with GET Z and GET ZE 
  1545.       is different from the use with other input commands where it denotes a 
  1546.       time to wait for input.
  1547.  
  1548.     GET Z can have several uses.  A few that come to mind are: uppercase a 
  1549.       string to test it with the IF subcommand, measure the length of a 
  1550.       string, count the number of times through a loop by measuring the length 
  1551.       of a string that has a character concatenated on each pass, fill out a 
  1552.       string to a fixed length by concatenating blanks and measuring its 
  1553.       length, extract a substring from a string.
  1554.  
  1555.     EXAMPLES:
  1556.  
  1557.     1. Place a string in the master Environment.  The master Environment will 
  1558.       then contain "GET=This is the string" and the ErrorLevel will be the 
  1559.       length of the string (18).  To verify that the string was placed in the 
  1560.       master Environment, first run a secondary command processor by typing 
  1561.       COMMAND at the DOS prompt.  Then run this example and see that the 
  1562.       string is not in the current environment by entering SET and viewing the 
  1563.       Environment.  Finally, enter EXIT to return to the original command pro- 
  1564.       cessor and enter SET again to see that the string is actually in the 
  1565.       master Environment.
  1566.  
  1567.       GET Z "This is the string" /M
  1568.  
  1569.     2. Suppose you want to fill out a string with blanks to reach a certain 
  1570.       fixed length.  In this example let the fixed length be 16.  This is one 
  1571.       way to implement a loop and control the number of times the loop occurs. 
  1572.       You can either right justify or left justify, and you can append spaces, 
  1573.       unlike using the DOS SET command.
  1574.  
  1575.  
  1576.   GET Z                        Put String (Zap)                        Page 31
  1577.  
  1578.  
  1579.     Rem Get user input, maximum of 16 characters.
  1580.     get s "Enter name: "  tttttttttttttttt /a
  1581.     :FILL If less than 16 characters entered, fill with blanks.
  1582.     if ErrorLevel 16 goto LENOK
  1583.     Rem Append a blank and loop back to check if enough
  1584.     get z "%GET% "
  1585.     goto FILL
  1586.     :LENOK Now we have the length we want.
  1587.     Echo "The string is %GET%"
  1588.  
  1589.     3. Use GET Z to extract the 3rd, 4th, and 5th characters from a string.
  1590.  
  1591.     Rem Turn on GET's reporting feature
  1592.     SET GET?=ON
  1593.     GET Z "abcdef" 2 /w3
  1594.     The Environment is: cde
  1595.     The ErrorLevel is: 3
  1596.  
  1597.     4. Suppose there is an Environment variable named VER and that in this 
  1598.       case it has the value VER=3.31.  We can extract the DOS minor version 
  1599.       with GET Z as follows.
  1600.  
  1601.     GET Z "%VER%" 2
  1602.     The Environment is: 31
  1603.     The ErrorLevel is: 2
  1604.  
  1605.     5. Use GET Z to make sure an environment string is in uppercase to facili- 
  1606.       tate testing it with the BATch IF subcommand.  Spaces will be converted 
  1607.       to ASCII-255 otherwise the DOS IF test would fail.  Remember to use 
  1608.       ASCII-255 for the test in your BATch file if there are any spaces.  Let 
  1609.       "varname" be the name of a variable in the Environment.
  1610.  
  1611.       GET Z "%varname%" /U /Vvarname=
  1612.       Rem In the next line, the "space" between B and S is really ASCII-255.
  1613.       IF "%varname%"=="BOB STEPHAN" goto NAMEOK
  1614.       Echo The name did not match
  1615.       goto END
  1616.       :NAMEOK
  1617.       Echo The name matched
  1618.       :END
  1619.  
  1620.  
  1621.   Page 32                         Standard Input                        GET ZE
  1622.  
  1623.     GET ZE                                                      Standard Input
  1624.  
  1625.     Syntax: GET ZE "prompt" [/switches]
  1626.     Input:  "prompt" to be displayed.
  1627.             /switches - /A /M /V /U /W /L
  1628.     Output: ErrorLevel - length of string.
  1629.             Environment - string.
  1630.  
  1631.     ZE will take input from Standard Input and transfer it to the GET= or 
  1632.       /Vvar= variable in the Environment.  The input must be less than 80 
  1633.       characters and must be terminated with a carriage return.  ZE will take 
  1634.       input from the keyboard (Get String), or from redirection or piping.  If 
  1635.       you specify a prompt for ZE, it will be displayed before reading stan- 
  1636.       dard input.  GET ZE works similar to GET S, but uses DOS to obtain the 
  1637.       input string from the user; therefore, it is not able to monitor each 
  1638.       keystroke and will not be able to suppress Ctrl-Break with the /C 
  1639.       switch.  You can force the string to uppercase with the /U switch, or to 
  1640.       lowercase with the /L switch.
  1641.  
  1642.     /W can be used with both GET Z and GET ZE to specify the maximum length of 
  1643.       the string.  If the input string is longer than the maximum specified 
  1644.       with /W, it will be truncated to the length specified.
  1645.  
  1646.     EXAMPLES:
  1647.  
  1648.     1. GET S uses the BIOS interrupt to get characters from the user, but you 
  1649.       can also use DOS Standard Input with GET ZE.  The prompt will be dis- 
  1650.       played and the string can be entered from the keyboard for a maximum of 
  1651.       79 characters.  The /U switch can be used to force the environment vari- 
  1652.       able to uppercase, but the user will see it just as it was typed in.
  1653.  
  1654.       GET ZE "Enter a string: "  /U
  1655.  
  1656.     2. You can use GET ZE to pipe the current directory into the current En- 
  1657.       vironment by using DOS piping.  This could be used to redirect any stan- 
  1658.       dard output into an Environment variable.  Of course, GET Y is the 
  1659.       preferred method of putting the current directory into the Environment 
  1660.       with GET, but this illustrates the method to do it with any program that 
  1661.       writes to standard output.  In some cases piping CD into GET ZE might be 
  1662.       preferable because CD includes the drive specification.
  1663.  
  1664.     CD|GET ZE
  1665.     The Environment is: D:\QPRO
  1666.     The ErrorLevel is: 7
  1667.  
  1668.     3. You can read the first line of a text file.  If you don't want to see 
  1669.       the echo from DOS, redirect the output to NUL.  The general syntax is 
  1670.       GET ZE<filespec>NUL.  In this example, the output from the DOS DATE com- 
  1671.       mand is redirected to a file, then read in to the Environment with GET 
  1672.       ZE, and finally the day of the week is extracted with GET Z.  NOTE: The 
  1673.       date could also have been piped directly into GET as in the previous ex- 
  1674.       ample, but for the purposes of this example an intermediate file is 
  1675.       used.
  1676.  
  1677.  
  1678.   GET ZE                         Standard Input                        Page 33
  1679.  
  1680.  
  1681.     Rem Stack <return> to automate the DATE command.
  1682.     get u 13
  1683.     Rem Use the DOS DATE command to create a file for the date
  1684.     date >date.txt
  1685.     Rem The first line of the file will have the format
  1686.     Rem Current date is Sun 11-17-1991
  1687.     Rem Read the first line into the variable GET=.
  1688.     get ze <date.txt
  1689.     Rem Extract the day of the week in characters 17-19
  1690.     get z "%GET%" 16 /w3
  1691.     Rem The Environment will now contain the variable GET=Sun.
  1692.     Rem
  1693.     Rem NOTE: Different versions of DOS have different formats
  1694.     Rem for the output of the DATE command.
  1695.     Rem
  1696.     Rem Now erase the temporary file.
  1697.     del date.txt
  1698.  
  1699.  
  1700.  
  1701.   Page 34                           'Rithmetic                           GET R
  1702.  
  1703.     GET R                                                           'Rithmetic
  1704.  
  1705.     Syntax: GET R[E] num1 [/Wnum2] [/switches]
  1706.     Input:  one or two numbers, maximum of 4 digits each.
  1707.             /switches - /M /V /W
  1708.     Output: ErrorLevel - num1+num2, RE - num1-num2
  1709.             Environment - same as ErrorLevel
  1710.  
  1711.     R for 'Rithmetic adds or subtracts two numbers.
  1712.               GET R adds the two numbers
  1713.               GET RE subtracts the second from the first
  1714.  
  1715.     The arithmetic result is in both the Environment and ErrorLevel. If only 
  1716.       one number is given, the other number defaults to 0.  The max number of 
  1717.       digits for each number is 4. Thus a character representation of a number 
  1718.       can be converted to a number in the ErrorLevel.  See examples below for 
  1719.       information about results larger than 255 or negative.
  1720.  
  1721.     EXAMPLES:
  1722.  
  1723.     1. Convert a numerical Environment variable to an ErrorLevel.  Suppose the 
  1724.       following string is in the Environment: VAR=45. Then
  1725.  
  1726.     GET R %VAR%
  1727.  
  1728.     will set the ErrorLevel to 45, and place GET=45 in the Environment.
  1729.  
  1730.     2. Suppose you need to set up a loop in a BATch file.  You can do it this 
  1731.       way.
  1732.  
  1733.     SET COUNT=0
  1734.     :LOOP
  1735.     GET R %COUNT% /W1 /VCOUNT=
  1736.     Echo The count is %COUNT%
  1737.     IF NOT ERRORLEVEL 10 GOTO LOOP
  1738.  
  1739.     3. You can use GET R to pass a return code from a CALLed BATch file to its 
  1740.       parent.  Of course, this could have been done by SETting and Environe- 
  1741.       ment variable, but with GET R you can use the ErrorLevel if you want.
  1742.  
  1743.     Echo This is the child batch file.
  1744.     Rem Set the default ErrorLevel to 0, suppress Environment variable.
  1745.     GET R 0 /V-
  1746.     Rem Now make tests and set ErrorLevel accordingly.
  1747.     If "%COMSPEC%"=="C:\COMMAND.COM" get r 1 /V-
  1748.     If "%COMSPEC%"=="C:\4DOS.COM" get r 4 /V-
  1749.  
  1750.     @Echo off
  1751.     Rem This is the parent file.
  1752.     CALL CHILD
  1753.     If ErrorLevel 4 Echo 4DOS is loaded.
  1754.     If ErrorLevel 1 Echo COMMAND.COM is loaded.
  1755.     If Not ErrorLevel 1 Echo Unknown command processor.
  1756.  
  1757.     4. If the result is greater than 255, the ErrorLevel is modulo 256.
  1758.        For example: 256=0, 257=1, ..., 511=255, 512=0, etc.
  1759.  
  1760.     set GET?=on
  1761.  
  1762.  
  1763.   GET R                           'Rithmetic                           Page 35
  1764.  
  1765.     GET R 195 /W350
  1766.     The Environment is: 545
  1767.     The ErrorLevel is: 33
  1768.  
  1769.     5. GET uses simple computer integer arithmetic.  Negative numbers are not 
  1770.       recognized as such.  If a larger number is subtracted from smaller, the 
  1771.       result is 65536 minus the absolute value of the difference.
  1772.  
  1773.     GET RE 10 /W20
  1774.     The ErrorLevel is 246
  1775.     The Environment is 65526
  1776.  
  1777.  
  1778.   Page 36                      Clear (Blank) Screen                      GET B
  1779.  
  1780.     GET B                                                 Clear (Blank) Screen
  1781.  
  1782.     Syntax: GET B[E] [New attribute] [/switches]
  1783.     Input: desired new attribute in decimal for B, hex for BE.
  1784.            /switches /M /V
  1785.     Output: ErrorLevel - old attribute (decimal of course).
  1786.             Environment - old attribute in decimal, hex for BE.
  1787.  
  1788.     B  the screen Blanker actually performs a clear screen, not a true blank- 
  1789.       ing which leave the screen display intact but merely hides it.  By doing 
  1790.       so, it is able to control the screen attribute (color).   GET B uses 
  1791.       your color settings unless you give it a different attribute to use.  It 
  1792.       automatically adapts to any number of lines on the screen (e.g. EGA 43 
  1793.       or VGA 50).
  1794.  
  1795.     If an attribute argument is given it is taken to be a 1, 2, or 3-digit 
  1796.       decimal number that is converted to a two-digit hexadecimal number for 
  1797.       the attribute.  The same table of colors and attributes that is used for 
  1798.       the /A switch is used for the GET B command.
  1799.  
  1800.     BE regards an argument as a 1 or 2-digit hex number, and the GET value in 
  1801.       the Environment is in hex.
  1802.  
  1803.     EXAMPLES:
  1804.  
  1805.     1. Do a simple ClearScreen (CLS) without changing colors or number of 
  1806.       lines.  Suppose the old attribute was black and white.
  1807.  
  1808.     Rem Turn on GET reporting feature
  1809.     SET GET?=ON
  1810.     GET B
  1811.     The Environment is: 7
  1812.     The ErrorLevel is: 7
  1813.  
  1814.     2. Set color to blue background with white text.  Save the old attribute 
  1815.       in the environment variable ATTR.
  1816.  
  1817.     GET B 23 /VATTR=
  1818.     The Environment is: 7
  1819.     The ErrorLevel is: 7
  1820.  
  1821.     3. Restore the saved attribute.
  1822.  
  1823.     GET B %ATTR%
  1824.     The Environment is: 23
  1825.     The ErrorLevel is: 23
  1826.     Rem Turn off GET reporting feature
  1827.     SET GET?=
  1828.  
  1829.  
  1830.   GET V                       Get/set video mode                       Page 37
  1831.  
  1832.  
  1833.     GET V                                                   Get/set video mode
  1834.  
  1835.     Syntax: GET V[E] [New mode/color] [/switches]
  1836.     Input: optional new video mode for V or color for VE.
  1837.            /switches /M /V
  1838.     Output: ErrorLevel - old mode or color
  1839.             Environment - old mode or color
  1840.  
  1841.     V reports and optionally sets the video mode.  Don't change Video mode un- 
  1842.       less you have a specific reason for doing so to prevent setting a mode 
  1843.       that is not supported by the system running the BATch file.
  1844.  
  1845.     The following Video Display Mode table is excerpted from "The New Peter 
  1846.       Norton Programmer's Guide to The IBM PC & PS/2," page 72.
  1847.  
  1848.         Mode #    Type        Resolution    Colors     Video Subsystem
  1849.          0, 1     Text        40 x 25         16       CGA, EGA, MCGA, VGA
  1850.          2, 3     Text        80 x 25         16       CGA, EGA, MCGA, VGA
  1851.          4, 5     Graphics    320 x 200       4        CGA, EGA, MCGA, VGA
  1852.          6        Graphics    640 x 200       2        CGA, EGA, MCGA, VGA
  1853.          7        Text        80 x 25         Mono     CGA, EGA, MCGA, VGA
  1854.          8, 9, 10                                      PCjr only
  1855.          11, 12                                        Used internally
  1856.          13       Graphics    320 x 200       16       EGA, VGA
  1857.          14       Graphics    640 x 200       16       EGA, VGA
  1858.          15       Graphics    640 x 350       Mono     EGA, VGA
  1859.          16       Graphics    640 x 350       16       EGA, VGA
  1860.          17       Graphics    640 x 480       2        MCGA, VGA
  1861.          18       Graphics    640 x 480       16       VGA
  1862.          19       Graphics    320 x 200       25       MCGA, VGA
  1863.  
  1864.     EXAMPLES:
  1865.  
  1866.     1. Get the current video mode and save it in the variable VIDEO.  Change 
  1867.       to video mode 2.  Later restore the original mode.
  1868.  
  1869.     GET V 2 /vvideo=
  1870.     Rem Do what you need to with mode 2
  1871.     Rem Restore original mode
  1872.     GET V %VIDEO%
  1873.     Rem Clear out VIDEO variable
  1874.     SET VIDEO=
  1875.  
  1876.     2. Suppose you have an "ill behaved" program such as a game that leaves 
  1877.       the video in a graphics mode when it exits.  You can save the orginal 
  1878.       mode before executing the game, then restore it later.
  1879.  
  1880.     Rem Store original video mode
  1881.     GET V /vvideo=
  1882.     Rem Run the ill behaved game
  1883.     GAME
  1884.     Rem Restore original mode
  1885.     GET V %VIDEO%
  1886.     Rem Clear out VIDEO variable
  1887.     SET VIDEO=
  1888.  
  1889.  
  1890.   Page 38                      Get/set video border                     GET VE
  1891.  
  1892.     GET VE                                                Get/set video border
  1893.  
  1894.     VE will get/set the border color on a VGA or EGA monitor.  See the color 
  1895.       table below.  One interesting use is to set different border colors for 
  1896.       each of your DESQview windows if you are a DV user. GET VE will take any 
  1897.       of the 8 basic color codes 0-7.  The additional combinations that can be 
  1898.       used for /A or GET B have no meaning for GET VE.
  1899.  
  1900.             The color codes are:
  1901.                0 Black         2 Green      4 Red          6 Brown
  1902.                1 Blue          3 Cyan       5 Magenta      7 White
  1903.  
  1904.     EXAMPLES:
  1905.  
  1906.     1. Set the border color to red.  It was black.
  1907.  
  1908.     Rem Turn on GET reporting feature
  1909.     SET GET?=ON
  1910.     GET VE 4
  1911.     The Environment is: 0
  1912.     The ErrorLevel is: 0
  1913.     Rem Turn off GET reporting feature
  1914.     SET GET?=
  1915.  
  1916.  
  1917.   GET H                          Date and Time                         Page 39
  1918.  
  1919.  
  1920.     GET H                                                        Date and Time
  1921.  
  1922.     Syntax: GET H[E] code [/switches]
  1923.     Input: Code from the table below
  1924.            /switches /M /V
  1925.     Output: ErrorLevel -
  1926.             Environment -
  1927.  
  1928.     H  The H Date and Time command works differently than most of the others. 
  1929.       The value to be obtained is determined by a coded numerical argument. 
  1930.       The codes are as follows with 1 being the default.
  1931.           1 Day of the Week - Sunday=0           16 Hour
  1932.           2 Day of the Month                     32 Minute
  1933.           4 Month - January=1                    64 Second
  1934.           8 Year                                128 Odd or Even (H only)
  1935.  
  1936.       For H, only one value is returned for each call of GET.  The Environment 
  1937.       will contain the character representation of the ErrorLevel, except for 
  1938.       Year, or for the Odd/Even feature, or if no code is given.  Since Error- 
  1939.       Level has a maximum of 255, only the last two digits of the year will be 
  1940.       reported, but the Environment will have the full value.  If no code is 
  1941.       given, the ErrorLevel will contain the default Day of the Week but no 
  1942.       Environment variable will be created.
  1943.  
  1944.     The Odd/Even feature is obtained by adding 128 to the desired code.  The 
  1945.       Environment will contain the value for the code, but the ErrorLevel will 
  1946.       be 1 if the value is odd or 0 if it is even.  This provides a means to 
  1947.       alternate doing something like running COMPRESS on C: on even days and 
  1948.       D: on odd days.  A code of 128 by itself will put the odd or even in- 
  1949.       dicator for the Day of the Week in the ErrorLevel but no Environment 
  1950.       variable will be created.
  1951.  
  1952.     HE will place a concatenated string in the environment.  You can "build 
  1953.       your own" string.  HE requires that you add up the codes for the values 
  1954.       you want concatenated.  With this form of the command the ErrorLevel is 
  1955.       the length of the GET variable, but it is not very meaningful or useful. 
  1956.       128 does nothing for HE either.
  1957.  
  1958.     If you can find a use for it with HE, you can include a "prompt" string in 
  1959.       double quotes.  The Environment variable will contain the prompt string 
  1960.       with the requested date and/or time information concatenated.
  1961.  
  1962.     EXAMPLES:
  1963.  
  1964.     1.  This is a rather elaborate BATch file that can be called to provide a 
  1965.       formatted date.  Call it SHOWDATE.BAT.  When you call SHOWDATE it will 
  1966.       report something like "The date is August 25, 1991".  This information 
  1967.       could just as easily be stored as an Environment variable for use by 
  1968.       other BATch files and programs.
  1969.  
  1970.  
  1971.  
  1972.   Page 40                          Date and Time                         GET H
  1973.  
  1974.     @Echo Off
  1975.     GET H 4
  1976.     If "%GET%"=="12" set MONTH=December
  1977.     If "%GET%"=="11" set MONTH=November
  1978.     If "%GET%"=="10" set MONTH=October
  1979.     If "%GET%"=="9" set MONTH=September
  1980.     If "%GET%"=="8" set MONTH=August
  1981.     If "%GET%"=="7" set MONTH=July
  1982.     If "%GET%"=="6" set MONTH=June
  1983.     If "%GET%"=="5" set MONTH=May
  1984.     If "%GET%"=="4" set MONTH=April
  1985.     If "%GET%"=="3" set MONTH=March
  1986.     If "%GET%"=="2" set MONTH=February
  1987.     If "%GET%"=="1" set MONTH=January
  1988.     Get H 2 /VDAY=
  1989.     Get H 8 /VYR=
  1990.     Echo The date is %MONTH% %DAY%, %YR%
  1991.  
  1992.     2. A GET BATch file can easily be set up to wait until a given time by 
  1993.       using the H feature.  In this example the first pair of GET calls checks 
  1994.       every 15 minutes for the hour you want to wait until - in this case 11 
  1995.       p.m. or 23 in computer parlance.  The next pair of GET calls checks the 
  1996.       time once a minute and waits until the minute is 30.  The BATch file 
  1997.       will continue executing at 11:30 p.m. or shortly thereafter.
  1998.  
  1999.     @echo off
  2000.     :HOUR Check the hour every 15 minutes.
  2001.     GET C /W900
  2002.     GET H 16
  2003.     if not "%GET%"=="23" goto HOUR
  2004.     :MINUTE Check the minute every 60 seconds.
  2005.     GET C /W60
  2006.     GET H 32
  2007.     if not ErrorLevel 30 goto MINUTE
  2008.     Rem The BATch file will continue here at 11:30 p.m.
  2009.  
  2010.     3.  The above BATch file can be parameterized so it can be called with the 
  2011.       hour and minute that you want it to wait until.  Name this BATch file 
  2012.       WAITFOR.BAT, then at the DOS prompt enter WAITFOR hour minute.  For ex- 
  2013.       ample, WAITFOR 23 30.  A BATch file like this can be run in a DESQview 
  2014.       window in the background and produce an alarm at a given time, or ex- 
  2015.       ecute a program in the background or when the computer is unattended. 
  2016.       It can easily be tuned down to the minute, or even the second by how 
  2017.       fine you make the checkpoint intervals.
  2018.  
  2019.     @echo off
  2020.     :HOUR Check the hour every 15 minutes.
  2021.     GET C /W900
  2022.     GET H 16
  2023.     if not "%GET%"=="%1" goto HOUR
  2024.     :MINUTE Check the minute every 60 seconds.
  2025.     GET C /W60
  2026.     GET H 32
  2027.     if not ErrorLevel %2 goto MINUTE
  2028.     Rem The BATch file will continue here at the hour and minute you specify.
  2029.     Rem Sound your alarm, or do whatever here, for example,
  2030.     Echo ^G  ^G  ^G  ^G  ^G
  2031.  
  2032.  
  2033.  
  2034.   GET H                          Date and Time                         Page 41
  2035.  
  2036.     4. Here are some BATch statements I use in my AUTOEXEC.BAT to do some 
  2037.       things only once a day, such as run DOS 5.0 MIRROR to save a copy of my 
  2038.       system information in case of a crash.  The current date is saved on 
  2039.       disk in a BATch file named SETDATE.BAT.  It contains one line, for exam- 
  2040.       ple: SET DATE=29.  When I CALL SETDATE it stores the last saved date in 
  2041.       the Environment as the DATE= variable.  Then I use GET to get today's 
  2042.       date and compare it with %DATE%.  If they compare, I know that I have 
  2043.       already done my once-a-day procedures and can skip them this time.  If 
  2044.       they don't compare, a new SETDATE.BAT is automatically created, and the 
  2045.       once-a-day statements are executed.  Follow it through here:
  2046.  
  2047.     Rem Call SETDATE to store the last saved date in the Environment
  2048.     CALL SETDATE
  2049.     Rem Get today's date to compare with.
  2050.     GET H 2
  2051.     Rem Compare the last saved date with today's date.
  2052.     IF "%DATE%"=="%GET%" GOTO DATEOK
  2053.     Rem If false, recreate SETDATE with today's date.
  2054.     ECHO SET DATE=%GET% >SETDATE.BAT
  2055.     Rem Do your once-a-day procedures here; for example ...
  2056.     MIRROR D: E: F:
  2057.     Rem If the dates compared we would skip the above lines
  2058.     Rem thus speeding up succeeding boots.
  2059.     DATEOK:
  2060.     Rem Continue with your AUTOEXEC.BAT here.
  2061.     Rem Run MIRROR on your boot drive and load delete tracking for all drives
  2062.     MIRROR C: /TC /TD /TE /TF
  2063.  
  2064.     5. HE was designed to produce output in the same form required by the DOS 
  2065.       DATE and TIME commands.  For example, if you need to temporarily change 
  2066.       the system date (or time) and later restore it, you can do it with the 
  2067.       following BATch file.
  2068.  
  2069.     @Echo off
  2070.     Rem HE 14 will report mm-dd-yy in the Environment: 14=2+4+8.
  2071.     get HE 14 /VDATE=
  2072.     Rem Now set the date as you need it for whatever reason, for example:
  2073.     DATE 6-15-90
  2074.     Rem Now run the program that requires the new date.
  2075.     Rem . . .
  2076.     Rem Now restore the original date.
  2077.     DATE %DATE%
  2078.     Rem Clear out the DATE variable (unless you want to save it to use again).
  2079.     SET DATE=
  2080.  
  2081.     6. Concatenate a "prompt" string with the date.
  2082.  
  2083.     Rem Turn on the GET reporting feature
  2084.     SET GET?=ON
  2085.     GET HE "The date is" 14
  2086.     The Environment is: The date is  8-29-91
  2087.     The ErrorLevel is: 20
  2088.     Rem Turn off the reporting feature
  2089.     SET GET?=
  2090.  
  2091.  
  2092.   Page 42                         Keyboard BUffer                        GET U
  2093.  
  2094.  
  2095.     GET U                                                      Keyboard BUffer
  2096.  
  2097.     Syntax: GET U "chars" num /Wnum [/switches]
  2098.     Input: characters and key codes to place in key buffer
  2099.            /switches /M /V /W /B
  2100.     Output: ErrorLevel - Number of characters actually stacked
  2101.             Environment - Not used, GET or /V variable will be cleared out.
  2102.  
  2103.     U  will stack keys in the keyboard bUffer.  The syntax is GET U "chars" 
  2104.       num /Wnum where chars are any ASCII characters you want stacked in dou- 
  2105.       ble quotes, and the "num"s are decimal representations of values for ei- 
  2106.       ther ASCII codes or scan codes.  Up to 4 digits can be used for either 
  2107.       number.  E.g. to end the string with a carriage return use 13 or /W13. 
  2108.       To enter a scan code add it to 255.  Note that this is purposely dif- 
  2109.       ferent from the scan code surrogates for the GET C command.
  2110.  
  2111.     NOTE: GET U will only work on PC/XT's with BIOS dated 01/10/86 and later, 
  2112.       PC/AT's with BIOS dated 11/15/85 and later, and PS/2s!
  2113.  
  2114.     With GET U you can provide a default entry for a GET S string; however, 
  2115.       the DOS keyboard buffer only holds 15 characters, so it has to be rather 
  2116.       short.  Use GET U "default" followed by GET S "prompt", and the default 
  2117.       string will be entered for the user.  The user can either change it by 
  2118.       backspacing or accept it by pressing enter.
  2119.  
  2120.     The ErrorLevel will contain the number of characters or codes actually 
  2121.       placed in the buffer.  If the buffer fills up before all the characters 
  2122.       or codes are stacked, GET will beep and exit.  By testing the ErrorLevel 
  2123.       for the number of characters and codes, you can tell if the stacking was 
  2124.       successful.  To make the full buffer available, the /B switch can be 
  2125.       used to clear the buffer.
  2126.  
  2127.     EXAMPLES
  2128.  
  2129.     1. The following will stack the word "help" in the buffer and execute it 
  2130.       as a command by also stacking the Enter key (ASCII 13 for CR).  To make 
  2131.       the stacked command execute, the BATch file must exit to activate the 
  2132.       DOS prompt.
  2133.  
  2134.     GET U "help" 13 /B
  2135.     Rem Test that 5 characters were stacked
  2136.     if ErrorLevel 5 goto EXIT
  2137.     Rem Not all characters were stacked, so clear the buffer and exit
  2138.     GET I /B
  2139.     :EXIT
  2140.  
  2141.     2. The scan code for F1 is decimal 59 so use 314 (=59+255). The following 
  2142.       command will stack the F1 key (The HELP key for 4DOS):
  2143.  
  2144.     GET U 314
  2145.  
  2146.  
  2147.   GET U                         Keyboard BUffer                        Page 43
  2148.  
  2149.  
  2150.     3.  Some programs pause when they are loading and require the user to 
  2151.       press a key to continue.  If the program does not clear the keyboard 
  2152.       buffer, then GET U can stack the keystroke(s) to automate the loading of 
  2153.       the program.  It could also automate the first few program command keys. 
  2154.       In this example we will stack the characters to bring up a spreadsheet 
  2155.       file list in Quattro Pro.
  2156.  
  2157.     Rem /FR is the Retrieve command for Quattro Pro
  2158.     GET U "/FR"
  2159.     Rem Now call Quattro Pro - the spreadsheet list will be displayed.
  2160.     Q
  2161.  
  2162.  
  2163.   Page 44                          Shift Locks                          GET UE
  2164.  
  2165.     GET UE                                                         Shift Locks
  2166.  
  2167.     Syntax: GET UE [/Wnum] [/switches]
  2168.     Input: numerical code to set or clear keyboard locks.
  2169.            /switches /M /V /W
  2170.     Output: ErrorLevel - Old value
  2171.             Environment - Old value
  2172.  
  2173.     UE will let you adjust the Caps, Num, and Scroll Locks. Sum the numbers 
  2174.       for Scroll=16, Num=32, Caps=64 for the Locks you want to set.  The 
  2175.       other(s) will be cleared.  You must use GET UE /Wnum not just GET UE 
  2176.       num.  CAUTION: Don't forget the /W.
  2177.  
  2178.     EXAMPLES
  2179.  
  2180.     1. Turn off NumLock and ScrollLock, turn on CapsLock
  2181.  
  2182.     GET UE /W64
  2183.  
  2184.     2. Turn on both NumLock and CapsLock, turn off ScrollLock.
  2185.  
  2186.     Rem Turn on GET reporting feature
  2187.     SET GET?=ON
  2188.     GET UE /W96
  2189.     The Environment is: 64
  2190.     The ErrorLevel is: 64
  2191.  
  2192.     3. Turn off all key locks
  2193.  
  2194.     GET UE
  2195.     The Environment is: 96
  2196.     The ErrorLevel is: 96
  2197.     Rem Turn off GET reporting feature
  2198.     SET GET?=
  2199.  
  2200.     4. Turn on CapsLock, then restore original setting
  2201.  
  2202.     Rem Turn on Caps and Num Locks to get user input
  2203.     Rem Save original setting in LOCK.
  2204.     GET UE /W96 /VLOCK=
  2205.     Rem Get string input from user in upper case and numbers.
  2206.     GET S "Enter information now: "
  2207.     Rem Restore original lock settings
  2208.     GET UE /W%LOCK%
  2209.     Rem Clear out the LOCK variable
  2210.     SET LOCK=
  2211.  
  2212.  
  2213.   GET 2.5                 Get DISK and FILE Information                Page 45
  2214.  
  2215.   GET DISK and FILE Information
  2216.  
  2217.   The commands K, Q, L, F, and Y obtain information about disks and/or files. 
  2218.     Note that Q, K, and L check to see if the drive contains a formatted disk, 
  2219.     and they return an ErrorLevel 0 if it does not.  This avoids the Abort, 
  2220.     Retry, etc. error handling.  If the ErrorLevel is 0 the error code will be 
  2221.     in %GET% as a hexadecimal value.
  2222.  
  2223.   Some error code values of interest are:
  2224.         0 - Write protected diskette (n/a since GET does not write)
  2225.         1 - Invalid drive letter
  2226.         2 - Drive not ready - no disk or door open.
  2227.         4, 6, 7, 8, & B - Disk read errors
  2228.         C - General, nonspecific error.
  2229.         F - Invalid disk change
  2230.  
  2231.     GET K                                                  Get disk free space
  2232.  
  2233.     Syntax: GET K[E] [drive][/Wdiv] [/switches]
  2234.     Input:  drive letter and optionally divisor
  2235.             /switches - /M /V /L /W
  2236.     Output: ErrorLevel - KiloBytes/10, KE - KiloBytes/100
  2237.             Environment - KiloBytes
  2238.  
  2239.     K takes the argument to be a drive letter.  The colon is not required. 
  2240.       The default is the current drive.  Optionally a divisor can be included 
  2241.       after the /W switch.
  2242.  
  2243.     K, as well as Q and L, starts out by attempting a direct read of the disk. 
  2244.       If this fails by reason of one of the errors mentioned above, GET 
  2245.       reports the error and exits.  This avoids the annoying "Abort, Retry, 
  2246.       Ignore, Fail?" message if the drive is not ready for some reason, and 
  2247.       lets the BATch programmer handle the error as appropriate to the ap- 
  2248.       plication.  If the read is successful, GET K obtains the disk informa- 
  2249.       tion and calculates the free space.
  2250.  
  2251.     Disk free space is reported in kilobytes (kb) in the Environment.  To 
  2252.       verify the value you can take the free space reported by CHKDSK and di- 
  2253.       vide it by 1024, the number of bytes in a kb.  The result should come 
  2254.       out exactly.  The value reported in the Environment is the same for GET 
  2255.       K and GET KE.
  2256.  
  2257.     Since the ErrorLevel can only report numbers up to 255, GET reduces the 
  2258.       value that is reported, but this does not affect the value in the En- 
  2259.       vironment.  For GET K the number of kb is divided by 10, and for GET KE, 
  2260.       the kb is divided by 100.  For disks with very large partitions, this 
  2261.       may still not reduce the amount reported below 255, so GET also has pro- 
  2262.       visions for an optional programmer supplied divisor.  For example, an 
  2263.       argument of /W1024 will divide by 1024, and the ErrorLevel will contain 
  2264.       approximate megabytes of free space.  The /W notation is the new 
  2265.       preferred method.
  2266.  
  2267.     EXAMPLES:
  2268.  
  2269.     1. Assume that CHKDSK reports "8,386,560 bytes available on disk".  Then
  2270.     GET K reports
  2271.  
  2272.     Rem Turn on GET reporting feature
  2273.  
  2274.  
  2275.   Page 46                       Get disk free space                      GET K
  2276.  
  2277.     SET GET?=ON
  2278.     GET K
  2279.     The Environment is: 8190
  2280.     The ErrorLevel is: 255
  2281.  
  2282.     In this case 8190 divided by 10 is 819, a figure too large for the Error- 
  2283.       Level, so the ErrorLevel is set to the maximum value.
  2284.  
  2285.     2. Same assumption as 1.  GET KE reports
  2286.  
  2287.     GET KE
  2288.     The Environment is: 8190
  2289.     The ErrorLevel is: 81
  2290.  
  2291.     In this case the kb is divided by 100 and truncated by integer arithmetic 
  2292.       to 81.
  2293.  
  2294.     3. Same assumption as 1.  Suppose we want the free space in megabytes (mb) 
  2295.       on drive C:.
  2296.  
  2297.     GET K C /W1024
  2298.     The Environment is: 8190
  2299.     The ErrorLevel is: 7
  2300.  
  2301.     In this case, 8190 divided by 1024 is just under 8, but is truncated to 7 
  2302.       by the integer arithmetic used.  The BATch file is assured of at least 7 
  2303.       mb free.
  2304.  
  2305.     4. Obtain the free space on the diskette in drive B.  Assume that CHKDSK 
  2306.       reports 700,416 free.
  2307.  
  2308.     GET K b
  2309.     The Environment is: 684
  2310.     The ErrorLevel is: 68
  2311.     Rem Turn off GET reporting feature
  2312.     SET GET?=
  2313.  
  2314.     5.  There is no diskette in drive A:.  The error may be reported as 2 or 
  2315.       C.
  2316.  
  2317.     GET K A
  2318.     if not errorlevel 1 if not "%GET%"=="" goto DiskError
  2319.     Echo The free space on drive A: is %GET%
  2320.     goto exit
  2321.     :DiskError
  2322.     Echo Disk error %GET% on drive A:.
  2323.     :exit
  2324.  
  2325.  
  2326.   GET Q                    Get Disk Capacity (Quota)                   Page 47
  2327.  
  2328.     GET Q                                            Get Disk Capacity (Quota)
  2329.  
  2330.     Syntax: GET Q[E] [drive][/Wdiv] [/switches]
  2331.     Input:  drive letter and optionally divisor
  2332.             /switches - /M /V /W
  2333.     Output: ErrorLevel - KiloBytes/10, QE - KiloBytes/100
  2334.             Environment - KiloBytes
  2335.  
  2336.     Q reports the capacity of a disk.  GET Q works just like GET K except that 
  2337.       it returns the capacity of the disk as if it were empty. Q for Quota? 
  2338.       As with K, Q first determines that a formatted disk is present in the 
  2339.       drive.
  2340.  
  2341.     Q will most often be used to determine the type of diskette in a floppy 
  2342.       disk drive although it will work on a hard disk as well, if that is of 
  2343.       interest.  Before Q can make this determination, the disk must be 
  2344.       formatted, so it cannot be used to select the type of formatting to use 
  2345.       in a BATch file.
  2346.  
  2347.     For both Q and K the extended command divides the ErrorLevel by 100 but 
  2348.       does not change the Environment variable.  If you need a different 
  2349.       divisor for the ErrorLevel for K or Q, you can use the /W notation. This 
  2350.       divisor feature will be needed to get ErrorLevel information on large 
  2351.       partitions.
  2352.  
  2353.     EXAMPLES:
  2354.  
  2355.     1. A 360k diskette is in drive A:.  CHKDSK reports "362,496 bytes total 
  2356.       disk space".
  2357.  
  2358.     Rem Turn on GET reporting feature
  2359.     SET GET?=ON
  2360.     GET Q A
  2361.     The Environment is: 354
  2362.     The ErrorLevel is: 35
  2363.  
  2364.     That's right, in computer terms there are only 354kb on a nominal 360k 
  2365.       diskette after space is set aside for the boot record, FAT, and root 
  2366.       directory.  By the way, I think you will find that GET reports faster 
  2367.       than CHKDSK in spite of taking time to try the direct read to check for 
  2368.       drive ready.
  2369.  
  2370.     2. A 1.2mb diskette is in drive A:.  CHKDSK reports 1,213,952 total.
  2371.  
  2372.     GET QE A
  2373.     The Environment is: 1185
  2374.     The ErrorLevel is: 11
  2375.  
  2376.     3. A 720k diskette is in drive B:.  CHKDSK reports 730,416 bytes.
  2377.  
  2378.     GET Q b
  2379.     The Environment is: 713
  2380.     The ErrorLevel is: 71
  2381.  
  2382.     4. A 1.44mb disk is in drive B:.  CHKDSK reports 1,457,664 total bytes.
  2383.  
  2384.     GET Q B
  2385.     The Environment is: 1423
  2386.  
  2387.  
  2388.   Page 48                    Get Disk Capacity (Quota)                   GET Q
  2389.  
  2390.     The ErrorLevel is: 142
  2391.  
  2392.     5. CHKDSK reports 33,449,984 bytes total disk space on drive C:.  Use GET 
  2393.       to find the number of megabytes in the ErrorLevel.
  2394.  
  2395.     GET Q c /w1024
  2396.     The Environment is: 32666
  2397.     The ErrorLevel is: 31
  2398.     Rem Turn off GET reporting feature
  2399.     SET GET?=
  2400.  
  2401.     6.  There is no drive Z:.  The error may be reported as 1 or C.
  2402.  
  2403.     GET Q Z
  2404.     if not ErrorLevel 1 if not "%GET%"=="" goto DiskError
  2405.     Echo The disk in drive Z: has %GET% kilobyte capacity
  2406.     goto exit
  2407.     :DiskError
  2408.     if %GET%==1 Echo Invalid drive letter: Z.
  2409.     if %GET%==C Echo General failure on drive Z.
  2410.     :exit
  2411.  
  2412.  
  2413.   GET L                        Get volume label                        Page 49
  2414.  
  2415.     GET L                                                     Get volume label
  2416.  
  2417.     Syntax: GET L [drive]
  2418.     Input:  optional drive letter
  2419.             /switches - /M /V /U /L
  2420.     Output: ErrorLevel - 1=label found, 0=no label found
  2421.             Environment - Volume Label
  2422.  
  2423.     L gets the Volume Label of the specified disk.  The ErrorLevel is 0 if the 
  2424.       disk is not labelled, or 1 if the disk has a volume label.  The optional 
  2425.       argument is the drive letter, defaulting to the current drive.  If the 
  2426.       disk is not labelled, the GET variable will be expunged and the Error- 
  2427.       Level will be 0.
  2428.  
  2429.     Volume labels can be placed on disks when they are formatted by using the 
  2430.       /V switch with the FORMAT command, or later by using the DOS LABEL com- 
  2431.       mand, or other labelling utility.  Volume labels can be very useful in 
  2432.       identifying and cataloging diskettes, especially when they can be 
  2433.       checked automatically with a program such as GET.  Another use is to 
  2434.       verify that the user has inserted the correct diskette when running an 
  2435.       installation BATch program.
  2436.  
  2437.     Volume labels can be up to 11 characters.  DOS will allow any of the 256 
  2438.       ASCII and extended characters except ."/\[]:*|<>;,?, ASCII 0-31, and the 
  2439.       lower case alphabetic characters.  (Actually some LABEL programs allow 
  2440.       lower case and other characters such as the decimal point, but since DOS 
  2441.       converts lower case to caps and will not allow some characters it is 
  2442.       better to stick with caps and standard DOS labels.)  Even the space 
  2443.       character is allowable in a Volume label.  Therefore, with 184 charac- 
  2444.       ters to choose from, there is an almost endless set of combinations that 
  2445.       you can use.  To enter the extended characters above 127 hold down the 
  2446.       Alt key while typing the ASCII code on the number pad keys.  (On some 
  2447.       systems it is necessary to hold down both the Alt and the Shift keys 
  2448.       while typing an extended character.  You may be able to enter ASCII 127 
  2449.       with the Ctrl-BackSpace key.)  The file SCANCODE.DOC with the registered 
  2450.       version contains a table of all the ASCII characters.
  2451.  
  2452.     It is often convenient to have a space in a volume label, but most ver- 
  2453.       sions of DOS make it difficult to verify such a label with the BATch IF 
  2454.       subcommand.  To DOS the space is a delimiter, and the IF comparison will 
  2455.       fail, usually with some message such as "Bad command or file name".  To 
  2456.       work around this problem, GET provides a method to compare a string, 
  2457.       which may include one or more spaces, with the volume label of a disk by 
  2458.       using the LE command.  The test label is given in the argument and must 
  2459.       be enclosed in double quote characters.  The comparison is exact and 
  2460.       case sensitive, so get it right the first time.  If the string is less 
  2461.       than 11 characters long, do not include any trailing spaces to fill in 
  2462.       the 11 characters.  Only the characters up to the last non-space charac- 
  2463.       ter will be checked and additional spaces will cause the comparison to 
  2464.       fail.  If you need to test with the IF subcommand, the /U switch will 
  2465.       force lowercase letters (if any) to uppercase, and will convert spaces 
  2466.       to ASCII 255 characters.
  2467.  
  2468.     EXAMPLES:
  2469.  
  2470.     1. The disk in drive B: does not have a volume label.
  2471.  
  2472.     Rem Turn on GET reporting feature
  2473.  
  2474.  
  2475.   Page 50                        Get volume label                        GET L
  2476.  
  2477.     SET GET?=ON
  2478.     GET L B
  2479.     The ErrorLevel is: 0
  2480.  
  2481.     2. The disk in drive A: has the volume label BOB STEPHAN.
  2482.  
  2483.     GET L A
  2484.     The Environment is: BOB STEPHAN
  2485.     The ErrorLevel is: 1
  2486.  
  2487.     3. The disk in drive A: is not formatted.  The error may be reported as 
  2488.       'C' or one of the read error codes above.  Even though there is a value 
  2489.       in the environment, the ErrorLevel of 0 is sufficient to determine that 
  2490.       the disk does not have a volume label.
  2491.  
  2492.     GET L A
  2493.     if not errorlevel 1 goto NoLabel
  2494.     Echo The label on the disk in drive A: is %GET%
  2495.     goto exit
  2496.     :NoLabel
  2497.     if not "%GET%"=="" goto DiskError
  2498.     Echo There is no volume label on the disk in drive A:
  2499.     goto exit
  2500.     :DiskError
  2501.     Echo Error %GET% reading disk in drive A:
  2502.     :exit
  2503.  
  2504.  
  2505.   GET LE                       Match volume label                      Page 51
  2506.  
  2507.     GET LE                                                  Match volume label
  2508.  
  2509.     Syntax: GET LE "label" [drive]
  2510.     Input:  "label" for LE to match, optional drive letter
  2511.             /switches - /M /V /U /L
  2512.     Output: ErrorLevel - 1 =yes, 0=no
  2513.             Environment - Volume Label
  2514.  
  2515.     LE takes a trial label in the "label" argument and sets the ErrorLevel to 
  2516.       indicate whether the disk label matches.  The comparison is case sensi- 
  2517.       tive and there must not be any trailing blanks in the "label" argument. 
  2518.       The /U and /L switches affect only what is placed into the Enviroment 
  2519.       string and do not affect the comparison.
  2520.  
  2521.     EXAMPLES:
  2522.  
  2523.     1. Compare the volume label on the disk in drive A: with the string "BOB 
  2524.       STEPHAN"
  2525.  
  2526.     GET LE "BOB STEPHAN" A
  2527.     The Environment is: BOB STEPHAN
  2528.     The ErrorLevel is: 1
  2529.  
  2530.     2. Compare the volume label on the disk in drive A: with the string "BOB"
  2531.  
  2532.     GET LE "BOB" A
  2533.     The Environment is: BOB STEPHAN
  2534.     The ErrorLevel is: 0
  2535.     Rem Turn off GET reporting feature
  2536.     SET GET?=
  2537.  
  2538.  
  2539.  
  2540.  
  2541.   Page 52                          Get file size                         GET F
  2542.  
  2543.     GET F                                                Get file size (DIR=0)
  2544.  
  2545.     Syntax: GET F[E] filespec [/switches]
  2546.     Input: file specification including path but no wildcards.
  2547.            /switches /M /V /L /X /W /A
  2548.     Output: ErrorLevel - F: KiloBytes; FE: KiloBytes/10.
  2549.                        With /A: Bytes (up to 255).
  2550.             Environment - file size in KiloBytes, Bytes, or Hex bytes
  2551.  
  2552.     The file specification (filespec) is not in quotes and must not contain 
  2553.       wild card characters, but may contain drive and path information.
  2554.  
  2555.     F reports file size.  The result is reported as kilobytes which allows 
  2556.       sizes up to 261,120 bytes to be reported in the ErrorLevel.  For FE the 
  2557.       divisor is 10 so that files up to 2,611,200 bytes can be reported in the 
  2558.       ErrorLevel.  The /Wnum switch can be used to specify a divisor other 
  2559.       than 10 for either F or FE in the same manner as for GET K and GET Q. 
  2560.       The size in kilobytes will be divided by the divisor and the result 
  2561.       placed in the ErrorLevel.  These divisions affect the ErrorLevel only, 
  2562.       the value in the Environment will not be changed.  Values in the En- 
  2563.       vironment can be up to 655,530 kilobytes.  If it is possible to have 
  2564.       larger files on your system, the value for larger files will have an 
  2565.       asterisk as the last character indicating that the value is not valid, 
  2566.       but is larger than 655,530 kilobytes (671,262,720 bytes).
  2567.  
  2568.     If /A is specified, All the bytes in the file size will be reported in the 
  2569.       Environment for files up to 655,350 bytes.  If over that size, the value 
  2570.       will have an asterisk as the last character indicating that the size is 
  2571.       not valid, but that it is larger than 655,350 bytes. If the file is 255 
  2572.       bytes or less, the full size will be in the ErrorLevel.  The /Wdiv 
  2573.       switch can be used to specify a divisor for larger files so that the 
  2574.       resulting ErrorLevel will be less than 255.  The divisor does not affect 
  2575.       the Environment variable.
  2576.  
  2577.     The /X switch can be used to cause the exact file size to be reported in 
  2578.       the Environment in hexadecimal as was done in versions prior to 2.5.
  2579.  
  2580.     If the filespec cannot be found, the GET variable will be expunged from 
  2581.       the Environment and a standard DOS error code will be returned in the 
  2582.       ErrorLevel.  The error codes of special interest are:
  2583.          2 for "File not found"
  2584.          3 for "Path not found"
  2585.         15 for "Invalid drive"
  2586.  
  2587.     Directory existence:  The F command for GET Filesize can be used to 
  2588.       determine whether a named directory exists.  As usual, if the filespec 
  2589.       is a directory, the ErrorLevel will be 0 and the Environment variable 
  2590.       will be '0'.
  2591.  
  2592.     For example: GET F "d:\mydir\xxx" will return 2 if the path is found but 
  2593.       not the file named XXX, a 3 if the path D:\MYDIR is not found, or a 15 
  2594.       if there is no D: drive.  GET F "d:\mydir" will return either 2 or 15 
  2595.       since it is not clear whether MYDIR is supposed to be a file or a path. 
  2596.       Whenever the item specified in the filespec may not exist, always check 
  2597.       for an empty GET variable (IF "%GET%"=="") which indicates that an error 
  2598.       code is in the ErrorLevel.
  2599.  
  2600.  
  2601.  
  2602.   GET F                          Get file size                         Page 53
  2603.  
  2604.     NOTE: The use of GET F to test for the existence of a directory is valid 
  2605.       only for subdirectories, and not for a root directory.  Since DOS does 
  2606.       not recognize the root directory as a file, commands such as GET F \, 
  2607.       GET F c:\, GET F c:, etc. are not valid.  Also, although it is a docu- 
  2608.       mented procedure in MS DOS 5.0, do not use the NUL device to check for a 
  2609.       directory if any users might be using DR DOS 5.0.  DR DOS 5 thinks that 
  2610.       the NUL (and other) devices exist even in non-existent directories.  It 
  2611.       may be that a few other versions of DOS do not support the NUL device 
  2612.       method of checking, but GET will work with them all.
  2613.  
  2614.     Device Drivers: GET F can be used as a means of communication between your 
  2615.       CONFIG.SYS and your AUTOEXEC.BAT.  GET F will take the name of a device 
  2616.       driver that may have been loaded in CONFIG.SYS and check to see if it 
  2617.       has, in fact been loaded.  The response will be similar to that for a 
  2618.       DIR; i.e. if the driver is loaded, 0 in the ErrorLevel and "0" in the 
  2619.       Environment.  If the driver is not loaded, the Environment variable will 
  2620.       be empty, and the ErrorLevel will contain an error code, usually 2. 
  2621.       CAUTION!  The name you use for the driver must be the INTERNAL name, not 
  2622.       necessarily the same name you use in CONFIG.SYS.  Most memory mapping 
  2623.       commands and programs will show the internal name that you must use. 
  2624.       This method will not work for ANSI.SYS and its clones because they use 
  2625.       the name CON, but GET A is available to determine whether ANSI.SYS is 
  2626.       loaded.  (With all that said, it is only fair to point out that you can 
  2627.       accomplish the same effect with IF EXIST by using the internal name of 
  2628.       the device driver.)
  2629.  
  2630.     EXAMPLES:
  2631.  
  2632.     1. Check to see if the device QEMM is loaded.  The internal name for QEMM 
  2633.       is QEMM386$.  In this example, the driver is loaded.
  2634.  
  2635.     Rem Turn on GET reporting feature
  2636.     SET GET?=ON
  2637.     get F QEMM386$
  2638.     The Environment is: 0
  2639.     The ErrorLevel is: 0
  2640.  
  2641.     2. Same example, but QEMM is not loaded.
  2642.  
  2643.     get F QEMM386$
  2644.     The ErrorLevel is: 2
  2645.  
  2646.     3. Check for the existence of a directory named D:\QPRO\WQ1.  IN this ex- 
  2647.       ample the directory exists.
  2648.  
  2649.     GET F D:\QPRO\WQ1
  2650.     The Environment is: 0
  2651.     The ErrorLevel is: 0
  2652.  
  2653.     4. Same example, but the directory does not exist.  The ErrorLevel is 
  2654.       reported as 2 meaning "File not found" because it cannot be determined 
  2655.       of WQ1 is a file or a subdirectory.
  2656.  
  2657.     GET F D:\QPRO\WQ1
  2658.     The ErrorLevel is: 2
  2659.  
  2660.     5. Suppose a file named d:\qpro\wq1\taxes.wq1 is a valid file name.  Using 
  2661.       GET F to get the file size could produce any of the following results.
  2662.  
  2663.  
  2664.   Page 54                          Get file size                         GET F
  2665.  
  2666.  
  2667.     Rem If you enter an invalid directory:
  2668.     GET F D:\QPRO\WQ\TAXES.WQ1
  2669.     The ErrorLevel is: 3
  2670.  
  2671.     Rem If the file does not exist after all:
  2672.     GET F D:\QPRO\WQ1\TAXES.WQ1
  2673.     The ErrorLevel is: 2
  2674.  
  2675.     Rem If the file is found to have 23,129 bytes:
  2676.     GET F D:\QPRO\WQ1\TAXES.WQ1
  2677.     The Environment is: 23
  2678.     The ErrorLevel is: 23
  2679.     GET F D:\QPRO\WQ1\TAXES.WQ1 /X
  2680.     The Environment is: 5A59
  2681.     The ErrorLevel is: 23
  2682.     Rem Turn off GET reporting feature
  2683.     SET GET?=
  2684.  
  2685.     7. Suppose you have a file of exactly 166,816 bytes.  You could see the 
  2686.       following results.
  2687.  
  2688.     GET F filespec
  2689.     The Environment is: 163
  2690.     The ErrorLevel is: 163
  2691.  
  2692.     GET F filespec /A
  2693.     The Environment is: 166816
  2694.     The ErrorLevel is: 255
  2695.  
  2696.     GET F filespec /A /W1000
  2697.     The Environment is: 166816
  2698.     The ErrorLevel is: 166
  2699.  
  2700.     GET F filespec /A /W1000 /X
  2701.     The Environment is: 28BA0
  2702.     The ErrorLevel is: 166
  2703.  
  2704.  
  2705.     7. Suppose we have a file we want to copy to drive B:, but we want to 
  2706.       check if there is enough space for it.  Note that file size is rounded 
  2707.       up and disk space is truncated by integer arithmetic so the result here 
  2708.       will err on the safe side if at all.  Since GET F reports kilobytes in 
  2709.       the ErrorLevel, and GET K reports kilobytes in the Environment, we can 
  2710.       test as follows:
  2711.  
  2712.  
  2713.  
  2714.   GET F                          Get file size                         Page 55
  2715.  
  2716.     @echo off
  2717.     Rem First get the disk free space on drive B: and save it in FREE=
  2718.     get k b /VFREE=
  2719.     Rem Check for error
  2720.     if not errorlevel 1 goto error
  2721.     Rem Now get the size of the file and check if there is enough room.
  2722.     get f filename.ext
  2723.     Rem Check for error
  2724.     if "%GET%"=="" goto error
  2725.     Rem If the ErrorLevel is not greater than the free kilobytes goto sizeok.
  2726.     if not errorlevel %FREE% goto sizeok
  2727.     Echo There is insufficient space on Drive B: for filename.ext.
  2728.     goto exit
  2729.     :sizeok
  2730.     copy filename.exe b:
  2731.     goto exit
  2732.     :error
  2733.     Echo An error has occurred
  2734.     :exit
  2735.     Rem Clear out the FREE variable
  2736.     SET FREE=
  2737.  
  2738.  
  2739.   Page 56                        Current Directory                       GET Y
  2740.  
  2741.     GET Y                                                Get current directory
  2742.  
  2743.     Syntax: GET Y[E] [drive for Y] [/switches]
  2744.     Input:  optional drive letter for Y, none for YE
  2745.             /switches /M /V /L
  2746.     Output: ErrorLevel - Y: directory level, root=0; YE: current drive, A=0.
  2747.             Environment - directory path (Y) or drive letter (YE).
  2748.  
  2749.     Y  gets the current directory for the default or a specified drive.  It 
  2750.       takes an optional drive letter argument (the : is not necessary) which 
  2751.       defaults to the current drive if omitted.  The ErrorLevel reports the 
  2752.       directory level - 0 = root directory, 1 for first subdirectory level, 
  2753.       etc. Note that DOS maintains a "current directory" for each drive, not 
  2754.       just for the logged drive, so it makes sense to inquire about the cur- 
  2755.       rent directory on a drive other than the logged drive.
  2756.  
  2757.     YE returns the current (or logged) drive.  The drive letter is in the En- 
  2758.       vironment, and the drive number in the ErrorLevel - 0=A, 1=B, etc.
  2759.  
  2760.     EXAMPLES:
  2761.  
  2762.     1. Suppose the following conditions exist - logged drive is C:, current 
  2763.       directory on C: is C:\DOS, current directory on D: is D:\QPRO\WQ1, there 
  2764.       is no E: drive, a floppy disk with no subdirectories is in B:.  GET com- 
  2765.       mands will report as follows:
  2766.  
  2767.     Rem Turn on GET reporting feature
  2768.     SET GET?=ON
  2769.     GET Y
  2770.     The Environment is: \DOS
  2771.     The ErrorLevel is: 1
  2772.  
  2773.     GET Y D
  2774.     The Environment is: \QPRO\WQ1
  2775.     The ErrorLevel is: 2
  2776.  
  2777.     Rem Get the current drive and directory, and combine them to make
  2778.     Rem a full path that does not end in a trailing backslash.
  2779.     GET YE /VDIR=
  2780.     The Environment is: C
  2781.     The ErrorLevel is: 2
  2782.     GET Y
  2783.     The Environment is: \DOS
  2784.     The ErrorLevel is: 1
  2785.     if not ErrorLevel 1 set GET=
  2786.     SET DIR=%DIR%:%GET%
  2787.  
  2788.     GET Y B
  2789.     The Environment is: \
  2790.     The ErrorLevel is: 0
  2791.     Note: The root directory is the only case that GET ends the Environment
  2792.     variable with the \ character.  (It is easier to add one than to drop
  2793.     it off.)
  2794.  
  2795.     GET Y E
  2796.     The ErrorLevel is: 0
  2797.     Turn off GET reporting feature
  2798.     SET GET?=
  2799.  
  2800.  
  2801.   GET Y                        Current Directory                       Page 57
  2802.  
  2803.  
  2804.     2. You can "and" ErrorLevel checks together to check for a specific value. 
  2805.       In this example, use ErrorLevel to see if the current drive is B:.
  2806.  
  2807.     GET YE
  2808.     Rem if it is at least 1 and not 2 or more,
  2809.     Rem then it is exactly 1 meaning B:.
  2810.     if ErrorLevel 1 if not ErrorLevel 2 goto ISB
  2811.     Echo The current drive is not B:
  2812.     goto exit
  2813.     :ISB
  2814.     Echo The current drive is B:
  2815.     :exit
  2816.  
  2817.  
  2818.   Page 58               Get MEMORY and SYSTEM Information              GET 2.5
  2819.  
  2820.   GET MEMORY and SYSTEM Information
  2821.  
  2822.   The commands BR, P, E, M, D, 4, 7, and A obtain information about the opera- 
  2823.     ting system and hardware configuration.
  2824.  
  2825.     GET BR                                                  Get/Set Break Flag
  2826.  
  2827.     Syntax: GET BR [New flag] [/switches]
  2828.     Input: optional new flag - 1 = ON, 0 = OFF.
  2829.            /switches /M /V
  2830.     Output: ErrorLevel - old break flag
  2831.             Environment - old break flag
  2832.  
  2833.     GET BR checks and/or sets the DOS BREAK Flag. It works like some of the 
  2834.       other get/set commands such as B and V. GET BR will report 1 if the 
  2835.       BREAK Flag is ON, or 0 if it is OFF.  In addition, GET BR 1 will turn it 
  2836.       on, and GET BR 0 will turn it off.  Although you can control BREAK with 
  2837.       the DOS BREAK command, GET BR allows you to store the user setting and 
  2838.       temporarily change it to suit your programming style.  Of course, if you 
  2839.       allow the user to BREAK out of your BATch file with DOS Ctrl-Break hand- 
  2840.       ling, you will not have the opportunity to reset it, but if you want to 
  2841.       handle BREAK yourself and use /C regularly, then you can get, set, and 
  2842.       restore the user BREAK Flag with GET BR.
  2843.  
  2844.     GET BR also gives you another method of communicating information from 
  2845.       your CONFIG.SYS to your AUTOEXEC.BAT.  You can set BREAK ON or OFF in 
  2846.       CONFIG.SYS according to whatever you want it to mean, and use GET BR to 
  2847.       check and optionally reset it in your AUTOEXEC.BAT, then take some ac- 
  2848.       tion according to whether it was ON or OFF.
  2849.  
  2850.     EXAMPLES:
  2851.  
  2852.     1. Save user Break flag setting so you can turn it off to help you do your 
  2853.       own Ctrl-Break management with the /C switch.  When finished, restore 
  2854.       user's original flag setting.
  2855.  
  2856.     Rem set BREAK OFF and save old setting in variable BREAK=.
  2857.     GET BR 0 /VBREAK=
  2858.     Rem Now do whatever you want in the BATch file, such as:
  2859.     GET S "Enter your password: " /c
  2860.     Rem When finished, restore saved Break flag setting.
  2861.     GET BR %BREAK%
  2862.     Rem Don't forget to clear out the variable!
  2863.     SET BREAK=
  2864.  
  2865.     2.  Suppose in one CONFIG.SYS file you have BREAK=ON to indicate that you 
  2866.       are configuring for your CAD program, and in another CONFIG.SYS file you 
  2867.       have BREAK=OFF if you want to run your normal configuration.  In your 
  2868.       AUTOEXEC.BAT you can test the Break flag, set it to the setting you 
  2869.       want, and take appropriate action, thus using just one AUTOEXEC for both 
  2870.       configurations.
  2871.  
  2872.     Rem Get break flag setting and turn it off.
  2873.     GET BR 0
  2874.     if "%GET%"=="1" goto RUNCAD
  2875.     Rem Do your something else here.
  2876.     goto EXIT
  2877.     :RUNCAD
  2878.     Rem Run your CAD program here.
  2879.     :EXIT
  2880.  
  2881.  
  2882.   GET P                     Check for Printer(PRN)                     Page 59
  2883.  
  2884.     GET P                                               Check for printer(PRN)
  2885.  
  2886.     Syntax: GET P[E] [/switches]
  2887.     Input: none
  2888.            /switches /M /V
  2889.     Output: ErrorLevel - 1=yes, 0=no
  2890.             Environment - 1=yes, 0=no
  2891.  
  2892.     P checks whether a printer is available and ready at LPT1 (PRN).  1=yes, 
  2893.       0=no.
  2894.  
  2895.     PE will also send the DOS BIOS initialization signal to the printer as it 
  2896.       does during boot-up.  This may not work if a print buffer or spooler is 
  2897.       in use unless it can be bypassed.  If your printer has an internal buff- 
  2898.       er this is a way to flush it.  If PE reports no printer, then the print- 
  2899.       screen operation (the Print Screen or Shift PrtSc key) will be disabled 
  2900.       to prevent hanging the computer if the PrtSc key is inadvertently 
  2901.       pressed.  To enable print-screen again, run GET PE with a printer at- 
  2902.       tached and ready.
  2903.  
  2904.     EXAMPLES:
  2905.  
  2906.     1. Check to see if a printer is available.
  2907.  
  2908.     GET P
  2909.     if ErrorLevel 1 goto PRINTIT
  2910.     Echo Can't print, no printer available.
  2911.     goto EXIT
  2912.     :PRINTIT
  2913.     copy filename.ext prn
  2914.     :EXIT
  2915.  
  2916.     2. Initialize printer, clearing the buffer and setting the page setting to 
  2917.       Top of Form (TOF).  If no printer is available, the Print Screen func- 
  2918.       tion will be turned off.
  2919.  
  2920.     GET PE
  2921.     if ErrorLevel 1 goto PRINTIT
  2922.     Echo Can't print, no printer available.
  2923.     Echo The print screen function has been disabled.
  2924.     goto EXIT
  2925.     :PRINTIT
  2926.     Echo The printer has been initialized, internal buffer cleared.
  2927.     :EXIT
  2928.  
  2929.  
  2930.   Page 60                      Get Environment Left                      GET E
  2931.  
  2932.  
  2933.     GET E                                                 Get Environment Left
  2934.  
  2935.     Syntax: GET E[E] [/switches]
  2936.     Input: none
  2937.            /switches /M /V
  2938.     Output: ErrorLevel - number of Environment bytes free, EE divides by 10.
  2939.             Environment - number of Environment bytes free
  2940.  
  2941.     E reports the number of bytes of Environment space available.  If it might 
  2942.       be over 255 use EE which divides the number of bytes by 10 for the Er- 
  2943.       rorLevel only, and can report up to 2550 bytes. Since GET makes ex- 
  2944.       tensive use of the Environment, it is always a good idea to use GET E at 
  2945.       the beginning of the BATch file to determine whether there are enough 
  2946.       bytes available for the use of GET in the BATch file.
  2947.  
  2948.     EXAMPLES:
  2949.  
  2950.     1. Suppose GET will require at least 15 bytes of Environment space for the 
  2951.       variables it will create in your BATch file.  Remember to include the 
  2952.       space required by the variable name, the = sign, and a terminating zero 
  2953.       byte that is automatically added internally.
  2954.  
  2955.     GET E
  2956.     if ErrorLevel 15 goto CONTINUE
  2957.     Echo Not enough free Environment space to run this BATch file.
  2958.     goto EXIT
  2959.     :CONTINUE
  2960.     Rem Continue with the BATch file
  2961.     :EXIT
  2962.  
  2963.     2. A more primitive method of checking for environment space is to attempt 
  2964.       to create a variable then see if it is there.  This may result in the 
  2965.       user seeing an "Out of environment space" message.
  2966.  
  2967.     Rem Try to create a variable that will use 16 bytes of space.
  2968.     SET TEST=1234567890
  2969.     if "%TEST%"=="1234567890" goto CONTINUE
  2970.     Echo Not enough free Environment space to run this BATch file.
  2971.     goto EXIT
  2972.     :CONTINUE
  2973.     Rem Don't forget to clear out your test variable
  2974.     SET TEST=
  2975.     Rem Continue with the BATch file.
  2976.     :EXIT
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.   GET M                         Get Memory Free                        Page 61
  2983.  
  2984.     GET M                                                      Get Memory Free
  2985.  
  2986.     Syntax: GET M[E] [/switches]
  2987.     Input: none
  2988.            /switches /M /V
  2989.     Output: ErrorLevel - number of kilobytes free, ME divides by 10.
  2990.             Environment - number of kilobytes free
  2991.  
  2992.     M  reports the free memory available in kilobytes.  ME divides by 10.
  2993.  
  2994.     EXAMPLES:
  2995.  
  2996.     1.   A BATch file can check if there is sufficient memory to run a pro- 
  2997.       gram.
  2998.  
  2999.     GET M
  3000.     if errorlevel 150 goto CONTINUE
  3001.     Echo Not enough memory to run your program.
  3002.     goto EXIT
  3003.     :CONTINUE
  3004.     Rem Run your program here.
  3005.     :EXIT
  3006.  
  3007.     2.  Suppose your program requires 300kb of memory.
  3008.  
  3009.     GET ME
  3010.     if errorlevel 30 goto CONTINUE
  3011.     Echo Not enough memory to run your program.
  3012.     goto EXIT
  3013.     :CONTINUE
  3014.     Rem Run your program here.
  3015.     :EXIT
  3016.  
  3017.  
  3018.   Page 62                         Get DOS Version                        GET D
  3019.  
  3020.     GET D                                                      Get DOS Version
  3021.  
  3022.     Syntax: GET D[E] [/switches]
  3023.     Input: none
  3024.            /switches /M /V
  3025.     Output: ErrorLevel - First two digits of DOS Version times 10.
  3026.             Environment - Major Version, DE gives Minor Version.
  3027.  
  3028.     D  reports the DOS version.  The ErrorLevel will contain a number such as 
  3029.       33 for DOS 3.3 and 3.31, or 50 for DOS 5.0.  The Environment will con- 
  3030.       tain the major version such as 3 for DOS 3.0, 3.1, 3.3, or 3.3.  DE will 
  3031.       report the minor version in the Environment such as 1 for DOS 3.1 or 0 
  3032.       for DOS 5.0.
  3033.  
  3034.     EXAMPLES:
  3035.  
  3036.     1. You're setting up a program for your clients and it requires something 
  3037.       different depending on whether the DOS Version is later than or earlier 
  3038.       than 3.1.
  3039.  
  3040.     GET D
  3041.     if ErrorLevel 31 goto DOS3
  3042.     Rem Do what you need here for DOS 2.x or 3.0.
  3043.     goto EXIT
  3044.     :DOS3
  3045.     Rem Do what you need here for DOS 3.1 and later.
  3046.     :EXIT
  3047.  
  3048.     2. You are distributing a program that requires DOS 3.3 or later.
  3049.  
  3050.     GET D
  3051.     if ErrorLevel 33 goto DOSOK
  3052.     Echo This program requires DOS 3.3 or later.
  3053.     goto EXIT
  3054.     :DOSOK
  3055.     Rem Run your program here.
  3056.     :EXIT
  3057.  
  3058.  
  3059.  
  3060.   GET 7                        Check Coprocessor                       Page 63
  3061.  
  3062.     GET 7                                                Check Coprocessor/CPU
  3063.  
  3064.     Syntax: GET 7[E] [/switches]
  3065.     Input: none
  3066.            /switches /M /V
  3067.     Output: ErrorLevel - 7: Math Coprocessor Installed - 7E: type of CPU.
  3068.             Environment - Character representation of ErrorLevel number.
  3069.  
  3070.     7  reports whether a math coprocessor is installed.  1=yes, 0=no.
  3071.  
  3072.     7E reports the CPU chip type - 0 for 8088/86, 2 for 80286, or 3 for 80386 
  3073.       or later.
  3074.  
  3075.     EXAMPLES:
  3076.  
  3077.     1. Run a faster version of a mathematical program if a coprocessor is in- 
  3078.       stalled.
  3079.  
  3080.     GET 7
  3081.     if ErrorLevel 1 goto NDP
  3082.     Rem Run the slower version here
  3083.     goto EXIT
  3084.     :NDP
  3085.     Rem Run the faster version here
  3086.     :EXIT
  3087.  
  3088.     2. Run the 386 version of a program if the CPU is an 80386 or later.
  3089.  
  3090.     GET 7E
  3091.     if ErrorLevel 3 goto IS386
  3092.     Rem Run the non-386 version here
  3093.     goto EXIT
  3094.     :IS386
  3095.     Rem Run the 386 version here
  3096.     :EXIT
  3097.  
  3098.  
  3099.   Page 64                       Check 4DOS/Windows                       GET 4
  3100.  
  3101.     GET 4                                                   Check 4DOS/Windows
  3102.  
  3103.     Syntax: GET 4[E] [/switches]
  3104.     Input: none
  3105.            /switches /M /V
  3106.     Output: ErrorLevel - 4: 4DOS - 7E: Windows.
  3107.             Environment - Character representation of ErrorLevel number.
  3108.  
  3109.     4 Checks whether 4DOS or [4E] Windows is currently running. 1=yes, 0=no. 
  3110.       Some DOS commands, such as CHKDSK, must not be run if Windows is run- 
  3111.       ning.  You can use this command to avoid these problems.
  3112.  
  3113.       4DOS provides a method to make this check directly with BATch commands. 
  3114.       It may be a convenience to use GET to get and store the information in 
  3115.       the same command.  4DOS provides a lot of services for BATch files, and 
  3116.       some DOS-like commands have extra features, but if the BATch file might 
  3117.       be run on a system that is not using 4DOS for the command processor 
  3118.       those extra features can't be used.
  3119.  
  3120.     EXAMPLES:
  3121.  
  3122.     1. If 4DOS is the command processor, use some of its special features.  If 
  3123.       not, make do the best you can with COMMAND.COM and GET.
  3124.  
  3125.     Rem Find out if 4DOS is running and store the information.
  3126.     GET 4 /V4DOS=
  3127.     if "%4DOS%"=="0" goto to MSDOS
  3128.     Rem Run your 4DOS enhanced commands here.
  3129.     goto EXIT
  3130.     :MSDOS
  3131.     Rem Do the best you can with MS DOS and GET here.
  3132.     :EXIT
  3133.     Rem Clear out the 4DOS variable
  3134.     SET 4DOS=
  3135.  
  3136.     2. Make a cover for CHKDSK to avoid damaging your disk if Windows is run- 
  3137.       ning.  Since CHKDSK is an external command, you can rename it to some- 
  3138.       thing else to avoid running it inadvertently.  Suppose we rename it 
  3139.       CHEKDISK.EXE and call this BATch file CHKDSK.BAT.
  3140.  
  3141.     @Echo off
  3142.     Rem This file is CHKDSK.BAT, a cover for DOS CHKDSK.
  3143.     get 4E
  3144.     if ErrorLevel 1 goto WINDOWS
  3145.     CHEKDISK %1 %2 %3
  3146.     goto EXIT
  3147.     :WINDOWS
  3148.     Echo Don't run CHKDSK when WINDOWS is running!
  3149.     :EXIT
  3150.  
  3151.  
  3152.  
  3153.   GET A                    Check for ANSI.SYS/Model                    Page 65
  3154.  
  3155.     GET A                                             Check for ANSI.SYS/Model
  3156.  
  3157.     Syntax: GET A[E] [/switches]
  3158.     Input: none
  3159.            /switches /M /V
  3160.     Output: ErrorLevel - A: ANSI.SYS - AE: ROM BIOS Model Byte
  3161.             Environment - A: 1=yes, 0=no - AE: Hexadecimal Model Byte
  3162.  
  3163.     A  reports whether ANSI.SYS is loaded.  If you are using an ANSI.SYS 
  3164.       clone, check to see if it works with yours.
  3165.  
  3166.     AE will return the ROM BIOS model byte.  At this time the documented model 
  3167.       bytes listed in "The NEW Peter Norton's Programmer's Guide to the IBM PC 
  3168.       and PS/2," (Page 64) are:
  3169.  
  3170.           FF(255)=PC(1981)
  3171.         FE(254)=PC or PC/XT(1982)
  3172.         FD(253)=PCjr(1983)
  3173.           FC(252)=PC/AT(1984-85),PC/XT Model 286(1986),PS/2 Model 50/60(1987)
  3174.           FB(251)=PC/XT(1986)
  3175.         FA(250)=PS/2 Model 25(1987)/30(1986)
  3176.           F9(249)=PC Convertible
  3177.         F8(248)=PS/2 Model 80(1987)
  3178.           (Example: My 80386 AT clone is an FC).
  3179.  
  3180.     EXAMPLES:
  3181.  
  3182.     1.  If the computer is running ANSI.SYS you can use it to provide special 
  3183.       screen effects.  For example, 4DOS has commands that take advantage of 
  3184.       the features of ANSI.SYS that won't work if ANSI.SYS isn't loaded.
  3185.  
  3186.     Rem Check for ANSI.SYS and store the result in ANSI=
  3187.     GET A /VANSI=
  3188.  
  3189.     2.  If you are supporting several computers and they are different models, 
  3190.       you may be able to determine which one is running the BATch file by 
  3191.       reading the model byte.
  3192.  
  3193.     GET AE
  3194.     if "%GET%"=="FC" goto ATCLONE
  3195.     if "%GET%"=="F9" goto CONVERT
  3196.     if "%GET%"=="FD" goto PCJR
  3197.     Rem Do things for other computers here
  3198.     goto EXIT
  3199.     :ATCLONE
  3200.     Rem Do things for AT Clone here
  3201.     goto EXIT
  3202.     :CONVERT
  3203.     Rem Do things for IBM Convertible here
  3204.     goto EXIT
  3205.     :PCJR
  3206.     Rem Do things for the PC Jr. here
  3207.     :EXIT
  3208.  
  3209.  
  3210.   Page 66                         Warm/Cold Boot                         GET W
  3211.  
  3212.     GET W                                                       Warm/Cold Boot
  3213.  
  3214.     Syntax: GET W[E] [arg] [/switches]
  3215.     Input: any argument to just report type of last boot.
  3216.            /switches /M /V
  3217.     Output: ErrorLevel - If arg, 1=warm, 0=cold
  3218.             Environment - If arg, 1=warm, 0=cold
  3219.  
  3220.     W  will reboot the computer as if the 3-finger salute (Ctrl-Alt-Del) was 
  3221.       pressed unless an arg is given.
  3222.  
  3223.     WE will reboot as if the computer was turned off then on again unless an 
  3224.       argument is given.
  3225.  
  3226.     If any characters are present as an argument with W or WE, GET will at- 
  3227.       tempt to determine if the preceding boot was warm or cold instead of 
  3228.       rebooting.  This does not work on all machines.  It depends on whether 
  3229.       the booting procedure clears a certain memory location - it worked on my 
  3230.       XT but not on my 386, for example.  If successful, a 1 indicates the 
  3231.       previous boot was warm, 0 means it was a cold boot.
  3232.  
  3233.     EXAMPLES
  3234.  
  3235.     1. Copy in a new AUTOEXEC.BAT and CONFIG.SYS and warm boot.
  3236.  
  3237.     copy autoexec.new autoexec.bat
  3238.     copy config.new config.sys
  3239.     get w
  3240.  
  3241.     2. Ask for a password, if it is wrong cold boot the computer.
  3242.  
  3243.     get S "Enter password now: " TTTTTTTT
  3244.     if "%GET%"=="PASSWORD" goto OK
  3245.     get we
  3246.     OK:
  3247.     Rem Password was correct, continue.
  3248.  
  3249.     3. Perform a CHKDSK if a cold boot but not a warm boot - may only work on 
  3250.       XT class machines.
  3251.  
  3252.     GET W xxx
  3253.     if ErrorLevel 1 CHKDSK
  3254.  
  3255.  
  3256.   GET 2.5                  The Environment and Shells                  Page 67
  3257.  
  3258.   The Environment and Shells
  3259.  
  3260.   This is a brief, general discussion of the DOS Environment for those who may 
  3261.     not be sufficiently familiar with it.  For a more extensive discussion of 
  3262.     the Environment, see Appendix A in the printed documentation provided with 
  3263.     the registered version.
  3264.  
  3265.      The DOS Environment is a small area (usually) of memory that DOS automat- 
  3266.     ically allocates to every program that it is asked to load or run.  The 
  3267.     "master" Environment is the original Environment allocated to COMMAND.COM 
  3268.     or 4DOS or whichever command processor you are using.  The original size 
  3269.     of the Environment can be set in later versions of DOS by using the SHELL 
  3270.     command in your CONFIG.SYS file.  However, the setting of Environment size 
  3271.     is not a SHELL command function, but is a command processor option.  For 
  3272.     example, the COMMAND.COM /E: switch lets you set the size if you are using 
  3273.     COMMAND.COM as your command processor.  For documentation look under such 
  3274.     topics as SHELL, COMMAND, and "Configuring Your System" in your DOS 
  3275.     manual.  Since most new programs make extensive use of the Environment, it 
  3276.     is important to be sure enough Environment space is allocated to accom- 
  3277.     modate them all.  If you see the error message "Out of Environment Space", 
  3278.     you know that you do not have enough allocated.
  3279.  
  3280.      You can view the contents of the Environment by issuing the SET command 
  3281.     of DOS with no arguments at the DOS prompt.  You will see a sequence of 
  3282.     variable names, each followed by the "=" sign and the string value as- 
  3283.     signed to the variable.  For example, COMSPEC=C:\COMMAND.COM.  You can 
  3284.     also store string information in the Environment with the SET command by 
  3285.     specifying it in the same manner as it is displayed.  For example, SET 
  3286.     PATH=C:\;C:\DOS.  Do not place any spaces on either side of the "=" sign 
  3287.     unless you intend for the space to be either a part of the variable name 
  3288.     or a part of the string.  When DOS loads and runs a COM or EXE program 
  3289.     file, that program receives a copy of the Environment as it is at that 
  3290.     time, trimmed down so that only a few bytes remain free.  This copy does 
  3291.     not change unless the program that owns it changes it.
  3292.  
  3293.      While COMMAND.COM and 4DOS are true shells, many users run programs from 
  3294.     within other programs also knows as "shells".  These include programs such 
  3295.     as PC Shell from Central Point's PC Tools, The Norton Commander, Xtree, 
  3296.     and many others.  Note that these DOS "shells" shield the master Environ- 
  3297.     ment from programs that are executed by the shell. If you find that to be 
  3298.     the case, the information will usually be available to the BATch file from 
  3299.     the Environment of the secondary command processor loaded by the shell as 
  3300.     is usually necessary to run a BATch file.  Except for the /M switch, GET 
  3301.     only attempts to locate the Environment of the command processor that is 
  3302.     running the BATch file, so the Environment information can disappear if 
  3303.     the shell or the secondary command processor is terminated.  GET attempts 
  3304.     to place the information where the BATch file can locate it since that is 
  3305.     its primary purpose.
  3306.  
  3307.   Out of Environment space
  3308.  
  3309.      When running a BATch file from a "shell" there may be problems with "Out 
  3310.     of Environment space" since DOS does not usually allocate excess Environ- 
  3311.     ment space to child processes.  4DOS and its alter-ego NDOS provide a 
  3312.     means to ensure that copies of the Environment have sufficient space 
  3313.     available, but COMMAND.COM is very stingy with the amount of free Environ- 
  3314.     ment space it allocates to child processes.  Check the documentation for  
  3315.  
  3316.  
  3317.   Page 68                  The Environment and Shells                  GET 2.5
  3318.  
  3319.     your shell program to see if it can make sufficient Environment space 
  3320.     available.  If you plan on running a BATch file from a shell and find that 
  3321.     "Out of environment space" is a problem, there are several things that you 
  3322.     can try to do.
  3323.  
  3324.     If COMMAND.COM is your command processor, in order to run your.bat you can 
  3325.     tell your shell to use the command, C:\COMMAND.COM /E:512 /Cyour.bat.  As- 
  3326.     suming that COMMAND.COM is in the root directory of the C: drive, this 
  3327.     will allocate 512 bytes of Environment space to your BATch file.  Just ad- 
  3328.     just the command for the proper location of your COMMAND.COM and the ac- 
  3329.     tual amount of Environment space you will need with the /E: switch.
  3330.  
  3331.     If your shell won't cooperate in running COMMAND.COM in this manner, then 
  3332.     you can establish a BATch file to do it for you.  Call it RUNBATCH.BAT and 
  3333.     make the first line %COMSPEC% /E:512 /C%1 %2 %3 etc.  Then when you want 
  3334.     to run your.bat, tell your shell to execute the command RUNBATCH your.bat. 
  3335.     Follow that with any parameters you need for your.bat and they will be 
  3336.     picked up by the %1 %2 %3 etc. replaceable parameters in RUNBATCH.BAT.
  3337.  
  3338.     Another method to ensure that GET has enough Environment space to store 
  3339.     its results is to establish a dummy GET variable before loading any shells 
  3340.     or other programs.  The best way would be to do it in your AUTOEXEC.BAT. 
  3341.     Simply insert the command SET GET=xxxxx...xxxx in your AUTOEXEC.BAT file 
  3342.     with enough x's or other characters for the maximum length input string 
  3343.     you are expecting.  Then in any BATch file that is to be run from the 
  3344.     shell, before using GET issue the command SET GET=.  This will remove the 
  3345.     GET variable from the Environment and free the space to be reused by GET.
  3346.  
  3347.  
  3348.   GET 2.5                      Program Information                     Page 69
  3349.  
  3350.   PROGRAM INFORMATION
  3351.  
  3352.     GET is programmed in assembly language for MS-DOS computers. It was as- 
  3353.     sembled with Borland's Turbo Assembler, and compressed with a file com- 
  3354.     pression utility. GET is designed to be small and fast to provide rapid 
  3355.     response in BATch files and not take up too much room on floppy disks, 
  3356.     consequently it does not do extensive error checking.  Nothing in GET is 
  3357.     known to cause harm, but if parameters are not used in accordance with the 
  3358.     documentation the results may not be what you expect.  GET is designed for 
  3359.     productive use by BATch programmers, not for casual use from the keyboard.
  3360.  
  3361.     In most applications there will be no noticeable slowing down of BATch 
  3362.     file execution due to the use of GET.  Most versions of DOS read and ex- 
  3363.     ecute lines of BATch files one at a time.  This is the slowest part of the 
  3364.     BATch execution process.  Providing there are sufficient DOS buffers or a 
  3365.     disk cache, GET will remain available in the buffers or cache in memory 
  3366.     and execute instantaneously when loaded by DOS.  Some additional speedup 
  3367.     may be noticed if it is possible to locate GET.EXE and/or your BATch file 
  3368.     on a virtual disk in RAM such as on a RAMDRIVE or VDISK.
  3369.  
  3370.     Some of the code for GET was adapted from the sample program named 
  3371.     WHAT.ASM included with Microsoft Macro Assembler (MASM).  The MASM docu- 
  3372.     mentation declares that the sample programs are in the public domain. For 
  3373.     examples of GET, look at the BATch files on the MASDIR disk mentioned be- 
  3374.     low for the use of a similar program called SDL_GET.  You can do a lot in 
  3375.     BATch programming with this utility.
  3376.  
  3377.   LICENSING AND DISTRIBUTION
  3378.  
  3379.     Although this version of GET remains free for personal use for all to en- 
  3380.     joy, if you like GET and would like to help support development of in- 
  3381.     expensive software, please send a contribution to the address below. 
  3382.     Thank you for any support you care to provide.  If you send $15 or more 
  3383.     (overseas $20 U.S. funds) you will receive the following benefits:
  3384.       The latest version of GET with any new features plus one free upgrade.
  3385.       A smaller runtime version to distribute with your BATch files.
  3386.       A single user license with no royalties for use of the runtime version.
  3387.       A >60 page user manual giving examples and more detailed explanations.
  3388.       Free support by BBS, mail, phone, CompuServe, or Genie (see below).
  3389.       Notification of new releases and upgrades after the first one.
  3390.     California residents please add 7.75% sales tax.  See the SPECIAL OFFER 
  3391.     below for a discount on registering both GET and MASDIR.
  3392.  
  3393.   If you have a modem, VISA and MASTERCARD registrations can be entered via 
  3394.     NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  3395.     tion, enter S for Script, then 3 for Script 3 and provide the requested 
  3396.     information.
  3397.  
  3398.     If you like and use GET but can't send money, at least drop me a note and 
  3399.     I'll put you on my list to receive new "freeware" releases as they become 
  3400.     available.  Your help in distributing new releases of GET will be ap- 
  3401.     preciated.
  3402.  
  3403.     CORPORATE users must obtain a site license from me for in-house use.  If 
  3404.     GET is to be installed on 2 machines $25, 3 machines $35, plus $5 for each 
  3405.     additional machine.   None of the above licensing terms includes using GET 
  3406.     in conjunction with the distribution of a commercial (retail) software 
  3407.     product other than shareware, user-supported, or public domain software.  
  3408.  
  3409.  
  3410.   Page 70                      Program Information                     GET 2.5
  3411.  
  3412.     To use GET in conjunction with the distribution of a retail software pro- 
  3413.     duct you must contact me to discuss terms.  Licenses are available for up 
  3414.     to 50 copies for $100, up to 500 copies for $200, unlimited copies for 
  3415.     $500.  Call or message me for quotes if you are interested.
  3416.  
  3417.     BBS SYSOPs, PC User Groups, and shareware authors and distributors are 
  3418.     hereby granted a single user license to use GET for their own purposes and 
  3419.     to freely distribute unmodified copies of this version of GET.EXE and the 
  3420.     associated files in GET25.ZIP.  If an unregistered version of GET is used 
  3421.     in conjunction with the distribution of a shareware or public domain soft- 
  3422.     ware product, the distribution disk must include GET25.ZIP.
  3423.  
  3424.     VENDORS who have my permission to distribute my shareware product MASDIR, 
  3425.     also have my permission to distribute GET.  Other vendors must contact me 
  3426.     for permission by sending me a request accompanied with a current catalog 
  3427.     or other list of offerings.
  3428.  
  3429.     REGISTERED users of GET may use and distribute GET in accordance with 
  3430.     these rules.  GETRUN.EXE is a runtime version of GET available only to 
  3431.     registered users.  It omits the online help screens and the debugging in- 
  3432.     formation so is considerably smaller - under 4k compressed file size - and 
  3433.     runs in less than 9k of memory.  GET is not a TSR so the memory is in use 
  3434.     only while GET is actually running.
  3435.  
  3436.     1. GET.EXE may be freely distributed provided the distribution disk in- 
  3437.     cludes all *.DOC and other GET distribution files.  Such distribution must 
  3438.     not include GETRUN.EXE under any name.
  3439.  
  3440.     2. If you are a licensed user of GETRUN.EXE, up to the licensed number of 
  3441.     copies of GETRUN.EXE may be renamed GET.EXE and used in conjunction with 
  3442.     distributed BATch files, provided that neither GET.DOC nor GET25NEW.DOC 
  3443.     are included on any disk in the distribution package.  For non-commercial 
  3444.     use, licensed users may use an unlimited number of copies.
  3445.  
  3446.     3. GET.EXE must never be included in any distribution that includes 
  3447.     GETRUN.EXE no matter what names are used for these files.
  3448.  
  3449.     If you have any questions, comments, or suggestions please contact me at:
  3450.         MOBY DISK: 1021 San Carlos Road, Pebble Beach, CA 93953
  3451.     Phone: (408) 646-1899/1373.    GENIE:MOBYDISK.      COMPUSERVE:72357,2276
  3452.     BBS: The Cricket 408-373-3773           /s/ Bob Stephan   January 10, 1992
  3453.  
  3454.     Now for the commercial
  3455.  
  3456.     If you like GET please try MASDIR!  MASDIR (pronounced 'master') the 
  3457.     MASter DIRectory System, is a general purpose sorted directory program 
  3458.     with unique customization and disk label printing features. If you ever 
  3459.     use DIR, you should do yourself a favor and take a look at MASDIR. MASDIR 
  3460.     is not a "shell"!  The main program, SDL.COM, is one of the best sorted 
  3461.     directory programs anywhere. The setup program allows you to set the many 
  3462.     defaults to your own specifications, including customizing the titles that 
  3463.     appear in the header. In addition, you can print disk labels and/or sleeve 
  3464.     inserts for 5.25" and 3.5" diskettes. This really saves you a lot of time 
  3465.     when you are looking through your collection of diskettes for a particular 
  3466.     file. They are all listed conveniently along with your own description in 
  3467.     the title lines. You can also create disk file catalogs of your diskettes 
  3468.     and directories that you can then annotate to describe individual files, 
  3469.     and search with your editor or listing program.
  3470.  
  3471.  
  3472.   GET 2.5              MASDIR, The MASter DIRectory System             Page 71
  3473.  
  3474.  
  3475.     Additional features include listing only subdirectories or not listing 
  3476.     them at all, listing only files created today or within a specified peri- 
  3477.     od, reverse sorting for any of the sort options, the amount of space a 
  3478.     group of files will occupy for different cluster sizes, support for DR DOS 
  3479.     and 4DOS, SETting defaults in the Environment, enter two file specifica- 
  3480.     tions such as *.COM *.EXE, paging up and down in large directories, show 
  3481.     only files that have not been backed up (archive bit set), and many more.
  3482.  
  3483.     As of the above date, the current release of MASDIR is Version 5.4. It is 
  3484.     a shareware program that is available on bulletin boards, GENIE, Com- 
  3485.     puServe, The Public (software) Library, PC-SIG, and from other distrib- 
  3486.     utors of public domain and shareware programs. If you cannot conveniently 
  3487.     locate a copy, I will be happy to send you one. Just contact me as indi- 
  3488.     cated above. The registration fee for MASDIR is $19 including shipping and 
  3489.     handling for the program, plus one unit of labels free.  Please include $2 
  3490.     S&H only if you order any amount of labels.
  3491.  
  3492.     SPECIAL OFFER.  Register both GET and MASDIR and take a 15% discount.  Use 
  3493.     the MASDIR order form and indicate that you want both MASDIR and GET for 
  3494.     just $29, instead of MASDIR by itself for $19.  Then complete the rest of 
  3495.     the form for any other items you want.
  3496.  
  3497.   If you have a modem, VISA or MASTERCARD registrations can be entered via 
  3498.     NITELOG BBS, 408-655-1096.  After completing the brief sign-on registra- 
  3499.     tion, enter S for Script, then 3 for Script 3.
  3500.  
  3501.     Thank you for your kind attention.                 /Bob/  January 10, 1992
  3502.